diff options
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index cb84d1d..5399fd0 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -8,6 +8,7 @@ #include <sstream> #include <utility> +#include <cm/string_view> #include <cmext/string_view> #include "cmsys/Directory.hxx" @@ -217,6 +218,7 @@ std::string const kCMAKE_POSITION_INDEPENDENT_CODE = std::string const kCMAKE_SYSROOT = "CMAKE_SYSROOT"; std::string const kCMAKE_SYSROOT_COMPILE = "CMAKE_SYSROOT_COMPILE"; std::string const kCMAKE_SYSROOT_LINK = "CMAKE_SYSROOT_LINK"; +std::string const kCMAKE_ARMClang_CMP0123 = "CMAKE_ARMClang_CMP0123"; std::string const kCMAKE_TRY_COMPILE_OSX_ARCHITECTURES = "CMAKE_TRY_COMPILE_OSX_ARCHITECTURES"; std::string const kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES = @@ -552,6 +554,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, fprintf(fout, "cmake_policy(SET CMP0104 OLD)\n"); } + /* Set ARMClang cpu/arch policy to match outer project. */ + if (cmProp cmp0123 = + this->Makefile->GetDefinition(kCMAKE_ARMClang_CMP0123)) { + fprintf(fout, "cmake_policy(SET CMP0123 %s)\n", + *cmp0123 == "NEW"_s ? "NEW" : "OLD"); + } + std::string projectLangs; for (std::string const& li : testLangs) { projectLangs += " " + li; |