summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-10-19 13:56:58 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-10-19 13:57:08 (GMT)
commit177c56e3fa7827629bde4289ec3b7e8661e47650 (patch)
tree50df54bb7492d12362308912408c032f4044e542 /Source/cmCoreTryCompile.cxx
parent077e42fe7648f4ef5c9741e7a1e085ee6c8685ab (diff)
parent50e90e282847f1109e5559d49fc12214b3493fff (diff)
downloadCMake-177c56e3fa7827629bde4289ec3b7e8661e47650.zip
CMake-177c56e3fa7827629bde4289ec3b7e8661e47650.tar.gz
CMake-177c56e3fa7827629bde4289ec3b7e8661e47650.tar.bz2
Merge topic 'try_compile-CMP0128' into release-3.25
50e90e2828 try_compile: Honor CMP0128 setting in test project Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Raul Tambre <raul@tambre.ee> Merge-request: !7803
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 588f44a..867f984 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -630,6 +630,12 @@ bool cmCoreTryCompile::TryCompileCode(Arguments& arguments,
fprintf(fout, "cmake_policy(SET CMP0126 OLD)\n");
}
+ /* Set language extensions policy to match outer project. */
+ if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0128) !=
+ cmPolicies::NEW) {
+ fprintf(fout, "cmake_policy(SET CMP0128 OLD)\n");
+ }
+
std::string projectLangs;
for (std::string const& li : testLangs) {
projectLangs += " " + li;