-
Notifications
You must be signed in to change notification settings - Fork 251
Add support for building cesium-native with Unity Web #1267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# Conflicts: # CMakeLists.txt
# Conflicts: # CHANGES.md # Cesium3DTilesSelection/src/RasterOverlayCollection.cpp # CesiumRasterOverlays/include/CesiumRasterOverlays/RasterOverlayTileProvider.h # CesiumRasterOverlays/src/RasterOverlayTileProvider.cpp
cesium-native doesn't depend on tidy-html, so a workaround for it doesn't belong here.
Instead of always disabling it for Emscripten, when this is really only need when building for Unity.
Because function overloading didn't work the way I had hoped.
|
I'm going to merge this. Thanks so much for all your work on it @brendan-duncan! And @azrogers as well! |
|
Woot! Thanks for doing so much cleaning up! |
|
Have you successfully built this in Release? |
|
Possibly not recently @Jason-EXP. Is it not working for you? |
@kring , I tried using a clean VM and it does work. It seems my dev machine has conflicting installations that caused an issue with Release builds. (i.e. Strawberry Perl) I have additional questions if you don't mind:
|
|
We had the same issue with Strawberry Perl's ccache on GitHub Actions for cesium-unity, @Jason-EXP. ada-url seems to be buggy in its (attempted) use of ccache. Our workaround was just to delete it:
Brendan wrote a custom The one in
I'm not sure. I'm not really an expert here. What problems are you running into when you try? |
This is a gold mine! Thanks for for this as it has the implementation I was looking for.
Though I can successfully create one if I use |
Add support for compiling cesium-native with Emscripten.
Unity Web currently uses Wasm32 so there are a number of changes to remove warnings related to compiling cesium-native as a 32-bit library. These typically were mis-matching of size_t to uint64_t, so I changed the variable types to be compatible with both 64-bit and 32-bit, to remove those warnings.
I added a CESIUM_WASM64 option to build for Wasm64, for when Unity supports it, or for any other platform that wants to build for Wasm64.
Many of the changes, including the ktx vcpkg port, came from Ashley's original PR, #1212.
See that PR for more detailed notes, Ashley wrote some very nice notes.
Building with Emscripten:
Make sure the Emscripten environment is setup with emsdk_env. Make sure ninja is in the executable path.
Setup Emsdk:
Before building, make sure the emsdk environment is set up with emsdk_env
Build and run tests: