summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-05-16 14:04:48 (GMT)
committerBrad King <brad.king@kitware.com>2022-05-16 14:39:42 (GMT)
commit4843a376767c2c4b46e29ed85ac823443317ca40 (patch)
tree0a957181b6b5e352e5793d2ff845b365fed50e59 /Source/cmCoreTryCompile.cxx
parent364fde65ee93588cb519ece09b161c0e8e826c3c (diff)
downloadCMake-4843a376767c2c4b46e29ed85ac823443317ca40.zip
CMake-4843a376767c2c4b46e29ed85ac823443317ca40.tar.gz
CMake-4843a376767c2c4b46e29ed85ac823443317ca40.tar.bz2
try_compile: Propagate platform variables in project-mode too
Add policy CMP0137 to propagate both our builtin variables and those listed by `CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` to `try_compile` whole-project builds. Inspired-by: Alexander Neumann <Alexander.Neumann@hamburg.de> Fixes: #23219
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 4909948..39c2b3a 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -872,7 +872,9 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
}
// Forward a set of variables to the inner project cache.
- if (this->SrcFileSignature) {
+ if (this->SrcFileSignature ||
+ this->Makefile->GetPolicyStatus(cmPolicies::CMP0137) ==
+ cmPolicies::NEW) {
std::set<std::string> vars;
vars.insert(&c_properties[lang_property_start],
&c_properties[lang_property_start + lang_property_size]);