CesiumGS / cesium-native

Apache License 2.0
391 stars 200 forks source link

Add support for static linking with MSVC runtime library #900

Closed jqntn closed 1 month ago

jqntn commented 1 month ago

Hi,

This change allows cesium-native to be linked either statically or dynamically with the MSVC runtime library, if specified in an upstream CMakeLists via the CMAKE_MSVC_RUNTIME_LIBRARY variable.

This will unblock another PR I'm preparing (https://github.com/CesiumGS/cesium-unity/pull/464) that addresses this issue: CesiumJS/cesium-unity#419, while maintaining compatibility with dynamically linked codebases (e.g. cesium-unreal).

The WITH_CRT_DLL flag in libjpeg-turbo was the only hardcoded flag in this regard.

kring commented 1 month ago

Thanks for the PR @jqntn! Before we review this, can you please sign the Contributor License Agreement (CLA)? https://github.com/CesiumGS/cesium/blob/main/CONTRIBUTING.md#contributor-license-agreement-cla

jqntn commented 1 month ago

@kring I just submitted it as a corporate contributor👍

csciguy8 commented 1 month ago

Thanks @jqntn!

I'll work on getting this merged into main.