summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2019-10-15 09:24:35 -0700
committerBrad King <brad.king@kitware.com>2019-10-15 13:25:14 -0400
commit466ad466b44561c8d48360fed0e491b3c09313be (patch)
tree740f60beca478f7aea9aeed745842d8702710c39 /Source
parent9150c818b7d2afb868575fcb2e0c9ba62b9d7f85 (diff)
downloadcmake-466ad466b44561c8d48360fed0e491b3c09313be.tar.gz
try_compile: support Swift for cross-compilation
Ensure that we preserve the `CMAKE_Swift_COMPILER_TARGET` variable to use cross-compilation for testing the Swift compiler if appropriate.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCoreTryCompile.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 515f446955..910cc9d5e8 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -56,6 +56,8 @@ static std::string const kCMAKE_POSITION_INDEPENDENT_CODE =
static std::string const kCMAKE_SYSROOT = "CMAKE_SYSROOT";
static std::string const kCMAKE_SYSROOT_COMPILE = "CMAKE_SYSROOT_COMPILE";
static std::string const kCMAKE_SYSROOT_LINK = "CMAKE_SYSROOT_LINK";
+static std::string const kCMAKE_Swift_COMPILER_TARGET =
+ "CMAKE_Swift_COMPILER_TARGET";
static std::string const kCMAKE_TRY_COMPILE_OSX_ARCHITECTURES =
"CMAKE_TRY_COMPILE_OSX_ARCHITECTURES";
static std::string const kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES =
@@ -671,6 +673,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
vars.insert(kCMAKE_SYSROOT);
vars.insert(kCMAKE_SYSROOT_COMPILE);
vars.insert(kCMAKE_SYSROOT_LINK);
+ vars.insert(kCMAKE_Swift_COMPILER_TARGET);
vars.insert(kCMAKE_WARN_DEPRECATED);
vars.emplace("CMAKE_MSVC_RUNTIME_LIBRARY"_s);