CesiumGS / cesium-native

Apache License 2.0
442 stars 215 forks source link

Unable to build when CESIUM_MSVC_STATIC_RUNTIME_ENABLED is ON #1014

Open jqntn opened 3 days ago

jqntn commented 3 days ago

Hi,

When the CESIUM_MSVC_STATIC_RUNTIME_ENABLED option of the CMakeLists.txt is set to ON, building cesium-native fails at the linker stage.

I'm using an up-to-date Visual Studio 2022 + CMake setup.

I know you managed to make this work for cesium-unity (see), didn't have time to investigate further.

Tested with v0.41.0.

image

kring commented 3 days ago

@jqntn the trick is to make sure your vcpkg triplet is also set to use the static runtime library. Here's where that's done in cesium-unity: https://github.com/CesiumGS/cesium-unity/blob/v1.13.1/native~/vcpkg/triplets/x64-windows-unity.cmake#L4