launchdarkly / cpp-sdks

C++ Client/Server SDKs
Other
5 stars 2 forks source link

build: do not set MSVC_RUNTIME_LIBRARY #370

Closed cwaldren-ld closed 6 months ago

cwaldren-ld commented 6 months ago

See: https://github.com/launchdarkly/cpp-sdks/issues/369

We're currently setting this variable explicitely. According to CMake docs, users can instead set CMAKE_MSVC_RUNTIME_LIBRARY:

This variable is used to initialize the MSVC_RUNTIME_LIBRARY property on all targets as they are created.

If it's not set, then:

If this variable is not set then the MSVC_RUNTIME_LIBRARY target property will not be set automatically. If that property is not set then CMake uses the default value MultiThreaded$<$:Debug>DLL to select a MSVC runtime library.

(source)

That default value is what we were explicitly setting, so by removing that config, there should be no change in behavior besides allowing users to have control over it.

Test build, Windows succeeds: https://github.com/launchdarkly/cpp-sdks/releases/tag/launchdarkly-cpp-server-v3.4.0

shortcut-integration[bot] commented 6 months ago

This pull request has been linked to Shortcut Story #233262: Respect CMAKE_MSVC_RUNTIME_LIBRARY.