summaryrefslogtreecommitdiffstats
path: root/Source/cmSearchPath.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSearchPath.cxx')
-rw-r--r--Source/cmSearchPath.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx
index d15ce57..766d347 100644
--- a/Source/cmSearchPath.cxx
+++ b/Source/cmSearchPath.cxx
@@ -181,7 +181,13 @@ void cmSearchPath::AddPrefixPaths(const std::vector<std::string>& paths,
const char* arch =
this->FC->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE");
if (arch && *arch) {
- this->AddPathInternal(dir + subdir + "/" + arch, base);
+ if (this->FC->Makefile->IsDefinitionSet("CMAKE_SYSROOT") &&
+ this->FC->Makefile->IsDefinitionSet(
+ "CMAKE_PREFIX_LIBRARY_ARCHITECTURE")) {
+ this->AddPathInternal(cmStrCat('/', arch, dir, subdir), base);
+ } else {
+ this->AddPathInternal(cmStrCat(dir, subdir, '/', arch), base);
+ }
}
}
std::string add = dir + subdir;