summaryrefslogtreecommitdiff
path: root/Source/cmFindCommon.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-05-11 14:00:08 +0000
committerKitware Robot <kwrobot@kitware.com>2017-05-11 10:00:12 -0400
commit8e2f3582eb9cf75c78fbe8232cdacce2357f7efc (patch)
treefcac3db79055770efdece88f06f8127b8b500d63 /Source/cmFindCommon.cxx
parent20c838da6bac1123cba65845f3ea730cd5ca51ab (diff)
parent53e89b6ab0cae7b9ba0316b3806abd986794a22c (diff)
downloadcmake-8e2f3582eb9cf75c78fbe8232cdacce2357f7efc.tar.gz
Merge topic 'split-sysroot'
53e89b6a Add options for separate compile and link sysroots Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !819
Diffstat (limited to 'Source/cmFindCommon.cxx')
-rw-r--r--Source/cmFindCommon.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 6ffbb6ef7b..df57a1bf2e 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);
}