Use CMake policy CMP0091 for MSVC runtime library selection - #2369
Merged
Conversation
Replace manual compiler flag manipulation with CMAKE_MSVC_RUNTIME_LIBRARY variable. Bump minimum CMake version to 3.15 for policy support. Default behavior remains /MT (static runtime). Users can override by setting CMAKE_MSVC_RUNTIME_LIBRARY before configuring. Resolves cinder#2117
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modernize MSVC runtime library configuration using CMake policy CMP0091 and the
CMAKE_MSVC_RUNTIME_LIBRARYvariable.Changes
/MDto/MTflag string manipulation withCMAKE_MSVC_RUNTIME_LIBRARYci_make_app()macroBehavior
Default: Static runtime (
/MTfor Release,/MTdfor Debug) - unchanged from previous behaviorUser override: Set
CMAKE_MSVC_RUNTIME_LIBRARYbefore including Cinder's CMake files, or via command line:cmake -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDebugDLL" ..Testing
Tested all Debug/Release configurations with both static (
/MT) and dynamic (/MD) runtimes. Verified correct runtime library selection via dumpbin and confirmed linker properly detects runtime mismatches.Resolves #2117