Skip to content

Use CMake policy CMP0091 for MSVC runtime library selection - #2369

Merged
andrewfb merged 1 commit into
cinder:masterfrom
andrewfb:cmake-cmp0091
Oct 9, 2025
Merged

Use CMake policy CMP0091 for MSVC runtime library selection#2369
andrewfb merged 1 commit into
cinder:masterfrom
andrewfb:cmake-cmp0091

Conversation

@andrewfb

@andrewfb andrewfb commented Oct 8, 2025

Copy link
Copy Markdown
Collaborator

Summary

Modernize MSVC runtime library configuration using CMake policy CMP0091 and the CMAKE_MSVC_RUNTIME_LIBRARY variable.

Changes

  • Bump minimum CMake version from 3.10 to 3.15
  • Enable CMake policy CMP0091 for MSVC runtime library selection
  • Replace manual /MD to /MT flag string manipulation with CMAKE_MSVC_RUNTIME_LIBRARY
  • Apply changes to both Cinder library build and ci_make_app() macro

Behavior

Default: Static runtime (/MT for Release, /MTd for Debug) - unchanged from previous behavior

User override: Set CMAKE_MSVC_RUNTIME_LIBRARY before 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

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
@andrewfb
andrewfb merged commit 2d7e537 into cinder:master Oct 9, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant