cesium-native 0.44.2
|
This guide contains the basic setup information for developers looking to work with Cesium Native. To follow this guide, you will need the following prerequisites:
Check out the repo with:
If you forget the --recurse-submodules
, nothing will work because the git submodules will be missing. You should be able to fix it with:
1) Install the CMake Tools
extension. It should prompt you to generate project files from CMake. 2) On Windows, choose Visual Studio 2017 Release - amd64
as the kit to build. Or choose an appropriate kit for your platform. 3) Then press Ctrl-Shift-P and execute the CMake: Build
task or press F7.
1) Open the CMake UI (cmake-gui) 2) Under "Where is the source code", point to your repo 3) Specify your output folder in "Where to build the binaries" 4) Click "Configure". 5) Under "Specify the generator for this project", choose the VS version on your system 6) Click Finish, wait for the process to finish 7) Click Generate
Look for cesium-native.sln in your output folder.
Unit tests can also be run from this solution, under the cesium-native-tests project.
npm install
cmake --build build --target cesium-native-docs
build/doc/html/index.html
Much of the code in CesiumGltf
, Cesium3DTiles
, CesiumGltfReader
, CesiumGltfWriter
, Cesium3DTilesReader
, Cesium3DTilesWriter
, and CesiumQuantizedMeshTerrain
is generated from the standards' JSON Schema specifications. To regenerate the code:
npm run generate-gltf
npm run generate-3d-tiles
npm run generate-quantized-mesh-terrain
git add
them and git will fix the line endings (no need to commit).The dependency graphs used in the Cesium Native documentation are generated using a script that parses CMake's GraphViz output and generates a set of Mermaid diagrams. To regenerate the graphs:
tools/dep-graph-gen
directory, run npm run generate-dep-graph
to regenerate the graphs.We use clang-tidy to help improve the quality of the code, and an automated process that runs on every commit ensures that there are no clang-tidy warnings or errors. To run it locally, follow the instructions for your system.
It's recommended to use WSL2 to run clang-tidy on Windows. The following instructions cover using clang-tidy through Visual Studio 2022's CMake support. To set up clang-tidy on WSL2, follow the Linux instructions below.
LLVM-19.x.x-win64.exe
and run the installer.compile_commands.json
file to be generated in the build directory in order to run. This file is only generated with the cmake Ninja or Unix Makefile generators. Visual Studio 2022's CMake support uses the Ninja generator. Open the Cesium Native cmake project with Visual Studio 2022.CMakeLists.txt
and select "CMake Settings for cesium-native" clang-tidy.exe
under "CMake command arguments": CESIUM_ENABLE_CLANG_TIDY_ON_BUILD
: Binaries and source releases for use with other platforms can be downloaded from the LLVM GitHub releases page.
clang-tidy-19
automatically, so the project can be configured normally:sed
to extract the errors and warnings from the log:sed
to extract the errors and warnings from the log: