CMake/Help/prop_tgt/MSVC_RUNTIME_CHECKS-VALUES.txt
AJIOB 2b2344b412 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
2025-01-29 13:07:41 -05:00

17 lines
625 B
Plaintext

``PossibleDataLoss``
Compile with ``-RTCc`` or equivalent flag(s) to enable possible
data loss checks.
``StackFrameErrorCheck``
Compile with ``-RTCs`` or equivalent flag(s) to enable stack frame
error checks.
``UninitializedVariable``
Compile with ``-RTCu`` or equivalent flag(s) to enable uninitialized
variables checks.
The value is ignored on compilers not targeting the MSVC ABI, but an
unsupported value will be rejected as an error when using a compiler
targeting the MSVC ABI.
The value may also be the empty string (``""``), in which case no runtime
error check flags will be added explicitly by CMake.