Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
90954d7
wip build for wasm
brendan-duncan Aug 12, 2025
7c16399
wip wasm build updates
brendan-duncan Aug 13, 2025
5882484
temp disable build from unity
brendan-duncan Aug 13, 2025
2db9ee9
add ktx port
brendan-duncan Aug 17, 2025
3485f96
fix wasm build
brendan-duncan Aug 22, 2025
2119030
fix generated path
brendan-duncan Aug 22, 2025
631bc48
generated path for webgl
brendan-duncan Aug 22, 2025
aac411e
use generated-WebGL instead of generated-Web
brendan-duncan Aug 23, 2025
36a29d9
update wasm cmake
brendan-duncan Aug 23, 2025
83417d9
Merge branch 'experiment_wasm' of https://github.com/brendan-duncan/c…
brendan-duncan Aug 23, 2025
efa3aef
install directly to plugins folder
brendan-duncan Aug 23, 2025
ecd5adf
install libs to plugins folder
brendan-duncan Aug 24, 2025
eb2ef24
Use custom JS webrequest for wasm
brendan-duncan Aug 24, 2025
454d6f8
fix editor build
brendan-duncan Aug 24, 2025
5d82a09
re-enable building for non-web
brendan-duncan Aug 24, 2025
88951ab
Change UnityTaskProcessor to use std::thread instead of System::Threa…
brendan-duncan Aug 25, 2025
25900c3
clean up printf
brendan-duncan Aug 25, 2025
6d768f7
Use a threadpool for UnityTaskProcessor wasm
brendan-duncan Aug 26, 2025
c0cb50e
Use main thread for UnityPrepareRenderResources wasm
brendan-duncan Aug 26, 2025
d69ac2b
change thread pool size to 4
brendan-duncan Aug 27, 2025
83c7aee
Add option to build wasm64
brendan-duncan Aug 27, 2025
497e9a7
Fix ezvcpkg dependency finding
brendan-duncan Aug 28, 2025
5561549
fix cors issue with google servers
brendan-duncan Aug 29, 2025
c6ce3c4
Build webgl native library from Unity build
brendan-duncan Aug 29, 2025
d02fa4f
disable wip wasm builder
brendan-duncan Aug 29, 2025
babb24b
Fix in-unity build of CesiumForUnityNative library for web
brendan-duncan Aug 29, 2025
947f34d
exclude libjpeg-turbo and add a meta file for libastcenc-none-static.…
brendan-duncan Aug 30, 2025
f1dc060
Fix web build failing first time
brendan-duncan Aug 30, 2025
966739e
WIP build on mac
brendan-duncan Sep 1, 2025
4f97617
add web builder to Package.cs
brendan-duncan Sep 1, 2025
c83ad80
Add EM_CONFIG to VCPKG_ENV_PASSTHROUGH_UNTRACKED
brendan-duncan Sep 4, 2025
a1b0ff2
Mark web static libs as WebGL Only
brendan-duncan Sep 4, 2025
f414f13
marge updates
brendan-duncan Sep 21, 2025
846cd22
Copy emscripten if unity path contains spaces
brendan-duncan Sep 22, 2025
53b7a05
print error if temp path has spaces
brendan-duncan Sep 22, 2025
400627a
delete temp emspcripten directory
brendan-duncan Sep 23, 2025
9c9b0f0
Use drive map instead of copy for emscripten path with space
brendan-duncan Sep 30, 2025
d94ce4d
Merge branch 'main' into experiment_wasm
brendan-duncan Oct 5, 2025
d8dd7ef
Clean up emsdk temp drive map
brendan-duncan Oct 6, 2025
bd504cc
Use ports to fix openssl and cpp-httplib build errors
brendan-duncan Oct 11, 2025
cf8d035
Merge branch 'main' into experiment_wasm
brendan-duncan Oct 19, 2025
b11d7a4
code cleanup
brendan-duncan Oct 20, 2025
f08c06f
code cleanup
brendan-duncan Oct 20, 2025
8d8dd53
revert mat changes
brendan-duncan Oct 20, 2025
1fc0742
code cleanup
brendan-duncan Oct 20, 2025
2aff99b
code cleanup
brendan-duncan Oct 20, 2025
5c54ac6
code cleanup
brendan-duncan Oct 20, 2025
fecde40
Use latest emscripten_wasm branch of cesium-native.
kring Nov 7, 2025
1b87460
Update cesium-native.
kring Nov 10, 2025
1f053db
Merge remote-tracking branch 'origin/main' into experiment_wasm
kring Nov 10, 2025
fe01c17
clang-format
kring Nov 10, 2025
8e4997f
Install Unity Hub `webgl` module.
kring Nov 10, 2025
d7b3e01
Allow target platforms to be specified on the command line.
kring Nov 11, 2025
e885b34
Add separate Emscripten build to CI.
kring Nov 11, 2025
14613ff
Add missing command.
kring Nov 11, 2025
c4a301b
Store Emscripten logs under correct name.
kring Nov 11, 2025
2222d75
Force use of Ninja for WebGL build.
kring Nov 11, 2025
b7e0a61
Publish ada-url build log as an artifact.
kring Nov 11, 2025
6b07879
Delete ccache.exe.
kring Nov 11, 2025
c418a8d
Don't try to run Emscripten tests.
kring Nov 11, 2025
48b1042
Try removing openssl overlay port.
kring Nov 12, 2025
af3ed3d
Use Enterprise Build Server license for macOS/Windows, Free for
kring Nov 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 152 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Install Unity
run: |
Start-Process -FilePath "C:/Program Files/Unity Hub/Unity Hub.exe" -Args "-- --headless install --version 2022.3.41f1 --changeset 0f988161febf" -Wait
Start-Process -FilePath "C:/Program Files/Unity Hub/Unity Hub.exe" -Args "-- --headless install-modules --version 2022.3.41f1 --changeset 0f988161febf --module android android-sdk-ndk-tools android-open-jdk-11.0.14.1+1 universal-windows-platform" -Wait
Start-Process -FilePath "C:/Program Files/Unity Hub/Unity Hub.exe" -Args "-- --headless install-modules --version 2022.3.41f1 --changeset 0f988161febf --module android android-sdk-ndk-tools android-open-jdk-11.0.14.1+1 universal-windows-platform" -Wait
- name: Create SSH tunnel to Unity License Server
env:
UNITY_LICENSE_SERVER_SSH_KEY: ${{ secrets.UNITY_LICENSE_SERVER_SSH_KEY }}
Expand All @@ -92,7 +92,7 @@ jobs:
run: |
mkdir -p $ENV:PROGRAMDATA/Unity/config
$filename="$ENV:PROGRAMDATA/Unity/config/services-config.json"
$text='{"licensingServiceBaseUrl":"http://localhost:12331","enableEntitlementLicensing":true,"clientConnectTimeoutSec":120,"clientHandshakeTimeoutSec":60}'
$text='{"licensingServiceBaseUrl":"http://localhost:12331","enableEntitlementLicensing":true,"clientConnectTimeoutSec":120,"clientHandshakeTimeoutSec":60,"toolset":"UnityLicenseServer_16768262570522_2"}'
[IO.File]::WriteAllLines($filename,$text)
- name: Update the version in Cesium.cpp
run: |
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
# Explicitly set the ezvcpkg path. Otherwise it will be `/.ezvcpkg` and the drive letter is ambiguous.
$ENV:EZVCPKG_BASEDIR="D:/.ezvcpkg"
# Run the build
dotnet run --project Build~
dotnet run --project Build~ package --platform Editor --platform Windows --platform UWP --platform Android
- name: Print disk space 2
if: success() || failure() # run this step even if previous step failed
run: |
Expand Down Expand Up @@ -233,7 +233,7 @@ jobs:
sudo mkdir -p "/Library/Application Support/Unity/config"
sudo chmod g+w "/Library/Application Support/Unity"
sudo chmod g+w "/Library/Application Support/Unity/config"
sudo echo '{"licensingServiceBaseUrl": "http://localhost:12331","enableEntitlementLicensing": true,"clientConnectTimeoutSec": 60,"clientHandshakeTimeoutSec": 120}' > "/Library/Application Support/Unity/config/services-config.json"
sudo echo '{"licensingServiceBaseUrl": "http://localhost:12331","enableEntitlementLicensing": true,"clientConnectTimeoutSec": 60,"clientHandshakeTimeoutSec": 120,"toolset":"UnityLicenseServer_16768262570522_2"}' > "/Library/Application Support/Unity/config/services-config.json"
- name: Create SSH tunnel to Unity License Server
env:
UNITY_LICENSE_SERVER_SSH_KEY: ${{ secrets.UNITY_LICENSE_SERVER_SSH_KEY }}
Expand Down Expand Up @@ -279,7 +279,7 @@ jobs:
# We only need a release build of vcpkg dependencies
export CESIUM_VCPKG_RELEASE_ONLY="TRUE"
cd ~/cesium/CesiumForUnityBuildProject/Packages/com.cesium.unity
dotnet run --project Build~
dotnet run --project Build~ package --platform Editor --platform macOS --platform iOS
ls -l ~/cesium/CesiumForUnityBuildProject
- name: Publish Logs
if: success() || failure() # run this step even if previous step failed
Expand Down Expand Up @@ -307,9 +307,129 @@ jobs:
name: Tests - macOS
path: /Users/runner/cesium/CesiumForUnityBuildProject/TestResults.xml
reporter: dotnet-nunit
Emscripten:
needs: [QuickChecks]
runs-on: windows-latest
# Only allow a single Emscripten build at a time, for Unity licensing reasons
concurrency: emscripten
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache vcpkg artifacts
uses: actions/cache@v4
with:
path: "d:/.ezvcpkg"
key: vcpkg-windows-${{ hashFiles('native~/vcpkg/ports/**/vcpkg.json', 'native~/vcpkg/triplets/**/*', 'native~/extern/*toolchain.cmake') }}-${{ hashFiles('native~/extern/cesium-native/CMakeLists.txt', 'native~/CMakeLists.txt') }}
restore-keys: |
vcpkg-windows-${{ hashFiles('native~/vcpkg/ports/**/vcpkg.json', 'native~/vcpkg/triplets/**/*', 'native~/extern/*toolchain.cmake') }}-
- name: Install latest ninja and cmake
uses: lukka/get-cmake@latest
with:
cmakeVersion: "3.31.6"
- name: Install nasm
uses: ilammy/setup-nasm@v1.5.1
- name: Install wget
run: |
choco install -y wget
- name: Install Unity Hub
run: |
wget https://public-cdn.cloud.unity3d.com/hub/prod/UnityHubSetup.exe
Start-Process "./UnityHubSetup.exe" -Args "/S" -Wait
del ./UnityHubSetup.exe
- name: Install Unity
run: |
# We must use Unity 6+ because the Emscripten version in older releases is too old.
Start-Process -FilePath "C:/Program Files/Unity Hub/Unity Hub.exe" -Args "-- --headless install --version 6000.0.62f1 --changeset f99f05b3e950" -Wait
Start-Process -FilePath "C:/Program Files/Unity Hub/Unity Hub.exe" -Args "-- --headless install-modules --version 6000.0.62f1 --changeset f99f05b3e950 --module webgl" -Wait
- name: Create SSH tunnel to Unity License Server
env:
UNITY_LICENSE_SERVER_SSH_KEY: ${{ secrets.UNITY_LICENSE_SERVER_SSH_KEY }}
run: |
$ENV:UNITY_LICENSE_SERVER_SSH_KEY | Set-Content ~/unity-client-ssh-key
# Without StrictHostKeyChecking, OpenSSH will sit forever waiting for local input to confirm the server key is ok.
# We don't really care if the server is authentic, because we're not sending anything sensitive to it.
# The license server VM's sshd_config also needed to be modified with the following options, in order to prevent
# the tunnel from being closed between here and when we're ready to use it.
# TCPKeepAlive yes
# ClientAliveInterval 30
# ClientAliveCountMax 9999
start -FilePath ssh -ArgumentList "-o StrictHostKeyChecking=no -i ~/unity-client-ssh-key -L 127.0.0.1:12331:127.0.0.1:8080 unity-client@ec2-44-204-244-196.compute-1.amazonaws.com"
sleep 5
- name: Test Connection to Unity License Server
run: |
wget.exe http://127.0.0.1:12331/v1/admin/status
cat status
rm status
- name: Configure Unity to Use the License Server
run: |
mkdir -p $ENV:PROGRAMDATA/Unity/config
$filename="$ENV:PROGRAMDATA/Unity/config/services-config.json"
$text='{"licensingServiceBaseUrl":"http://localhost:12331","enableEntitlementLicensing":true,"clientConnectTimeoutSec":120,"clientHandshakeTimeoutSec":60,"toolset":"UnityLicenseServer_16768262643415_1"}'
[IO.File]::WriteAllLines($filename,$text)
- name: Update the version in Cesium.cpp
run: |
$VERSION = (Get-Content -path package.json | ConvertFrom-Json).version
$COMMIT = $(git rev-parse --short HEAD)
((Get-Content -path native~/Shared/src/Cesium.cpp -Raw) -replace 'Cesium::version = "Development Build"',"Cesium::version = ""$VERSION""") | Set-Content -Path native~/Shared/src/Cesium.cpp
((Get-Content -path native~/Shared/src/Cesium.cpp -Raw) -replace 'Cesium::commit = "Unknown"',"Cesium::commit = ""$COMMIT""") | Set-Content -Path native~/Shared/src/Cesium.cpp
# Sanity check that the replacements happened
if (-Not ((Get-Content -path native~/Shared/src/Cesium.cpp -Raw) -match "$COMMIT")) { throw "Commit does not exist in file after replacement" }
if (-Not ((Get-Content -path native~/Shared/src/Cesium.cpp -Raw) -match "$VERSION")) { throw "Version does not exist in file after replacement" }
- name: Move cesium-unity Repo Under Empty Project
run: |
mkdir -p d:\cesium\CesiumForUnityBuildProject\Packages\com.cesium.unity
mv $ENV:GITHUB_WORKSPACE/* d:\cesium\CesiumForUnityBuildProject\Packages\com.cesium.unity
# Disable Unity audio
mkdir -p d:\cesium\CesiumForUnityBuildProject\Packages\com.cesium.unity\ProjectSettings
$text="%YAML 1.1`n%TAG !u! tag:unity3d.com,2011:`n--- !u!11 &1`nAudioManager:`n m_DisableAudio: 1`n"
[IO.File]::WriteAllLines("d:/cesium/CesiumForUnityBuildProject/Packages/com.cesium.unity/ProjectSettings/AudioManager.asset",$text)
- name: Build Reinterop
run: |
cd d:\cesium\CesiumForUnityBuildProject\Packages\com.cesium.unity
dotnet publish Reinterop~ -o .
- name: Print disk space 1
if: success() || failure() # run this step even if previous step failed
run: |
get-psdrive
- name: Delete ccache
run: |
# To prevent the ada-url build from trying (and failing) to use it.
rm C:/Strawberry/c/bin/ccache.exe
- name: Build Package
run: |
cd d:\cesium\CesiumForUnityBuildProject\Packages\com.cesium.unity
mkdir -p d:\cesium\temp
# Store temp files on the D drive, which is much faster than the EBS-backed C drive.
$ENV:TEMP="d:\cesium\temp"
# We only need a release build of vcpkg dependencies
$ENV:CESIUM_VCPKG_RELEASE_ONLY="TRUE"
# Clear ANDROID_NDK_ROOT so that we use Unity's version
Remove-Item Env:ANDROID_NDK_ROOT
# Explicitly set the ezvcpkg path. Otherwise it will be `/.ezvcpkg` and the drive letter is ambiguous.
$ENV:EZVCPKG_BASEDIR="D:/.ezvcpkg"
# Run the build
dotnet run --project Build~ package --platform Web
- name: Print disk space 2
if: success() || failure() # run this step even if previous step failed
run: |
get-psdrive
- name: Publish Logs
if: success() || failure() # run this step even if previous step failed
uses: actions/upload-artifact@v4
with:
name: Native Build Logs - Emscripten
path: d:/cesium/CesiumForUnityBuildProject/Packages/com.cesium.unity/native~/build-*/build.log
- name: Publish package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v4
with:
name: Emscripten Package
path: d:\cesium\CesiumForUnityBuildProject\*.tgz
Combine:
runs-on: ubuntu-latest
needs: [Windows, MacOS]
needs: [Windows, MacOS, Emscripten]
steps:
- name: Check out repository code
uses: actions/checkout@v4
Expand All @@ -325,6 +445,16 @@ jobs:
cd combine/macos
tar xzf *.tgz
rm *.tgz
- name: Download Emscripten build
uses: actions/download-artifact@v4
with:
name: Emscripten Package
path: combine/emscripten
- name: Extract Emscripten build
run: |
cd combine/emscripten
tar xzf *.tgz
rm *.tgz
- name: Download Windows build
uses: actions/download-artifact@v4
with:
Expand All @@ -342,6 +472,7 @@ jobs:

# Copy the everything. For files that exist in multiple packages, the Windows one will win.
cp -r ../macos/* .
cp -r ../emscripten/* .
cp -r ../windows/* .

# Remove the generated C# files
Expand All @@ -366,6 +497,21 @@ jobs:
mkdir -p $(dirname "../merged/$file")
cp "$file" "../merged/$file"
done;

cd ../emscripten
for file in $(find package/Runtime/generated -name '*.cs');
do
echo Merging $file
mkdir -p $(dirname "../merged/$file")
cat "$file" >> "../merged/$file"
done;
for file in $(find package/Editor/generated -name '*.cs');
do
echo Merging $file
mkdir -p $(dirname "../merged/$file")
cat "$file" >> "../merged/$file"
done;

cd ../windows
for file in $(find package/Runtime/generated -name '*.cs');
do
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
[submodule "Documentation~/doxygen-awesome-css"]
path = Documentation~/doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
[submodule "native~/extern/blend2d"]
path = native~/extern/blend2d
url = https://github.com/blend2d/blend2d
4 changes: 4 additions & 0 deletions Build~/Build~.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.CommandLine" Version="2.0.0-rc.2.25502.107" />
</ItemGroup>

</Project>
Loading