mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
MSVC: Add abstraction for runtime checks
Replace our hard-coded default for `/RTC1` with a first-class abstraction to select runtime checks from an enumeration of logical names. Add a `MSVC_RUNTIME_CHECKS` target property and corresponding `CMAKE_MSVC_RUNTIME_CHECKS` variable. Removing the old default flag requires a policy because existing projects may rely on string processing to edit them and choose runtime checks under the old behavior. Add policy CMP0184 to provide compatibility. Fixes: #26614
This commit is contained in:
@@ -349,6 +349,7 @@ as needed to honor the state of the calling project:
|
||||
* :policy:`CMP0155`
|
||||
* :policy:`CMP0157`
|
||||
* :policy:`CMP0181`
|
||||
* :policy:`CMP0184`
|
||||
|
||||
.. versionadded:: 4.0
|
||||
The current setting of :policy:`CMP0181` policy is propagated through to the
|
||||
@@ -417,6 +418,11 @@ configuration:
|
||||
propagated into the test project's build configuration when using the
|
||||
:ref:`whole-project signature <Try Compiling Whole Projects>`.
|
||||
|
||||
.. versionadded:: 4.0
|
||||
If :policy:`CMP0184` is set to ``NEW``, one can use
|
||||
:variable:`CMAKE_MSVC_RUNTIME_CHECKS` to specify the enabled MSVC runtime
|
||||
checks.
|
||||
|
||||
See Also
|
||||
^^^^^^^^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user