From 53e89b6ab0cae7b9ba0316b3806abd986794a22c Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 9 May 2017 14:08:15 -0400 Subject: 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 --- Source/cmCoreTryCompile.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/cmCoreTryCompile.cxx') 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 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( -- cgit v1.2.1