summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-07-21 15:31:16 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-07-21 15:31:29 (GMT)
commit992467c30c893eb592e4dad1f4d2b59eb9dfe3c4 (patch)
tree9f94af83b777a0c5dacfce94c9ccb95484988342 /Source
parentdee0b88e770282909716967b9d3f4e626827e4ae (diff)
parent144be54dd31ad1320e3efa9b2b30876dcadd590a (diff)
downloadCMake-992467c30c893eb592e4dad1f4d2b59eb9dfe3c4.zip
CMake-992467c30c893eb592e4dad1f4d2b59eb9dfe3c4.tar.gz
CMake-992467c30c893eb592e4dad1f4d2b59eb9dfe3c4.tar.bz2
Merge topic 'toolchain-CMP0126'
144be54dd3 try_compile: Propagate CMP0126 to the generated test project Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6366
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCoreTryCompile.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 8ecf264..bf18143 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -570,6 +570,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
*cmp0123 == "NEW"_s ? "NEW" : "OLD");
}
+ /* Set cache/normal variable policy to match outer project.
+ It may affect toolchain files. */
+ if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0126) !=
+ cmPolicies::NEW) {
+ fprintf(fout, "cmake_policy(SET CMP0126 OLD)\n");
+ }
+
std::string projectLangs;
for (std::string const& li : testLangs) {
projectLangs += " " + li;