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
This commit is contained in:
Brad King
2022-05-16 10:16:34 -04:00
parent 4843a37676
commit a6562ff579
10 changed files with 45 additions and 3 deletions

View File

@@ -216,3 +216,7 @@ a build configuration.
.. versionchanged:: 3.14
For the :generator:`Green Hills MULTI` generator the GHS toolset and target
system customization cache variables are also propagated into the test project.
.. versionadded:: 3.24
The :variable:`CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES` variable may be
set to disable passing platform variables into the test project.