diff options
author | Brad King <brad.king@kitware.com> | 2017-05-09 18:08:15 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-05-09 18:21:54 (GMT) |
commit | 53e89b6ab0cae7b9ba0316b3806abd986794a22c (patch) | |
tree | 45529a1a882e354379d151e88132be00a7286c99 /Source/cmFindCommon.cxx | |
parent | b69e061b8073efbd2c356f4508ea401c85e8dae3 (diff) | |
download | CMake-53e89b6ab0cae7b9ba0316b3806abd986794a22c.zip CMake-53e89b6ab0cae7b9ba0316b3806abd986794a22c.tar.gz CMake-53e89b6ab0cae7b9ba0316b3806abd986794a22c.tar.bz2 |
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/cmFindCommon.cxx')
-rw-r--r-- | Source/cmFindCommon.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index 110195c..5d46674 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -154,10 +154,16 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths) } const char* sysroot = this->Makefile->GetDefinition("CMAKE_SYSROOT"); + const char* sysrootCompile = + this->Makefile->GetDefinition("CMAKE_SYSROOT_COMPILE"); + const char* sysrootLink = + this->Makefile->GetDefinition("CMAKE_SYSROOT_LINK"); const char* rootPath = this->Makefile->GetDefinition("CMAKE_FIND_ROOT_PATH"); const bool noSysroot = !sysroot || !*sysroot; + const bool noCompileSysroot = !sysrootCompile || !*sysrootCompile; + const bool noLinkSysroot = !sysrootLink || !*sysrootLink; const bool noRootPath = !rootPath || !*rootPath; - if (noSysroot && noRootPath) { + if (noSysroot && noCompileSysroot && noLinkSysroot && noRootPath) { return; } @@ -166,6 +172,12 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths) if (rootPath) { cmSystemTools::ExpandListArgument(rootPath, roots); } + if (sysrootCompile) { + roots.push_back(sysrootCompile); + } + if (sysrootLink) { + roots.push_back(sysrootLink); + } if (sysroot) { roots.push_back(sysroot); } |