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)
commit797aa4c410b1ca5686e1b652be43875d3a091682 (patch)
tree6dfa993b93ef93f8a9cb0b8f0e5a0dad4e5c0fe9 /Source
parent31ecd3718047874b5eeb939e9608fa1bd386c1a7 (diff)
parent144be54dd31ad1320e3efa9b2b30876dcadd590a (diff)
downloadCMake-797aa4c410b1ca5686e1b652be43875d3a091682.zip
CMake-797aa4c410b1ca5686e1b652be43875d3a091682.tar.gz
CMake-797aa4c410b1ca5686e1b652be43875d3a091682.tar.bz2
Merge topic 'toolchain-CMP0126' into release-3.21
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;