summaryrefslogtreecommitdiff
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-05-09 14:08:15 -0400
committerBrad King <brad.king@kitware.com>2017-05-09 14:21:54 -0400
commit53e89b6ab0cae7b9ba0316b3806abd986794a22c (patch)
tree45529a1a882e354379d151e88132be00a7286c99 /Source/cmCoreTryCompile.cxx
parentb69e061b8073efbd2c356f4508ea401c85e8dae3 (diff)
downloadcmake-53e89b6ab0cae7b9ba0316b3806abd986794a22c.tar.gz
Add options for separate compile and link sysroots
Add `CMAKE_SYSROOT_COMPILE` and `CMAKE_SYSROOT_LINK` variables to as operation-specific alternatives to `CMAKE_SYSROOT`. This will be useful for Android NDKs that compile and link with different sysroot values (e.g. `r14` with unified headers). Co-Author: Florent Castelli <florent.castelli@gmail.com>
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 2287bc2d78..d8ddf459c0 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -41,6 +41,8 @@ static std::string const kCMAKE_OSX_SYSROOT = "CMAKE_OSX_SYSROOT";
static std::string const kCMAKE_POSITION_INDEPENDENT_CODE =
"CMAKE_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_TRY_COMPILE_OSX_ARCHITECTURES =
"CMAKE_TRY_COMPILE_OSX_ARCHITECTURES";
static std::string const kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES =
@@ -609,6 +611,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
vars.insert(kCMAKE_OSX_SYSROOT);
vars.insert(kCMAKE_POSITION_INDEPENDENT_CODE);
vars.insert(kCMAKE_SYSROOT);
+ vars.insert(kCMAKE_SYSROOT_COMPILE);
+ vars.insert(kCMAKE_SYSROOT_LINK);
vars.insert(kCMAKE_WARN_DEPRECATED);
if (const char* varListStr = this->Makefile->GetDefinition(