diff options
author | Brad King <brad.king@kitware.com> | 2022-05-16 14:16:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-05-16 14:47:21 (GMT) |
commit | a6562ff57908e6f03ef44eb0438ba9937f28174c (patch) | |
tree | 66891e45efadaa7589705021e66d96a476088e82 /Help/variable | |
parent | 4843a376767c2c4b46e29ed85ac823443317ca40 (diff) | |
download | CMake-a6562ff57908e6f03ef44eb0438ba9937f28174c.zip CMake-a6562ff57908e6f03ef44eb0438ba9937f28174c.tar.gz CMake-a6562ff57908e6f03ef44eb0438ba9937f28174c.tar.bz2 |
try_compile: Add option to skip passing platform variables
Add a `CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES` variable to tell
`try_compile` not to pass platform variables to the test project.
Issue: #23219
Diffstat (limited to 'Help/variable')
-rw-r--r-- | Help/variable/CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES.rst | 10 | ||||
-rw-r--r-- | Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES.rst b/Help/variable/CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES.rst new file mode 100644 index 0000000..944caa5 --- /dev/null +++ b/Help/variable/CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES.rst @@ -0,0 +1,10 @@ +CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES +--------------------------------------- + +Set to a true value to tell the :command:`try_compile` command not +to propagate any platform variables into the test project. + +The :command:`try_compile` command normally passes some CMake variables +that configure the platform and toolchain behavior into test projects. +See policy :policy:`CMP0137`. This variable may be set to disable +that behavior. diff --git a/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst b/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst index 5e84fd0..6b26d14 100644 --- a/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst +++ b/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst @@ -31,3 +31,7 @@ command source file signature. Listed variables are propagated to the :command:`try_compile` :ref:`whole-project <Try Compiling Whole Projects>` signature too. See :policy:`CMP0137`. + +.. versionadded:: 3.24 + The :variable:`CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES` variable may be + set to disable passing platform variables into the test project. |