summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-04-13 12:46:57 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-06-07 11:32:52 (GMT)
commitde4da665d3205afa239749c41513a315c3831f51 (patch)
tree02ab204c77efc1a89b620b38c118913c06c125f8 /Source/cmComputeLinkInformation.cxx
parentbb879bcf2dd8a65eeb285ef67aa72c16aab01938 (diff)
downloadCMake-de4da665d3205afa239749c41513a315c3831f51.zip
CMake-de4da665d3205afa239749c41513a315c3831f51.tar.gz
CMake-de4da665d3205afa239749c41513a315c3831f51.tar.bz2
Use --sysroot when cross compiling.
As CMAKE_ROOT_FIND_PATH can be a list, a new CMAKE_SYSROOT is introduced, which is never a list. The contents of this variable is passed to supporting compilers as --sysroot. It is also accounted for when processing implicit link directories reported by the compiler, and when generating RPATH information.
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r--Source/cmComputeLinkInformation.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 02495c4..b378391 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1884,6 +1884,8 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
}
if(use_build_rpath || use_link_rpath)
{
+ std::string rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
+ cmSystemTools::ConvertToUnixSlashes(rootPath);
std::vector<std::string> const& rdirs = this->GetRuntimeSearchPath();
for(std::vector<std::string>::const_iterator ri = rdirs.begin();
ri != rdirs.end(); ++ri)
@@ -1907,9 +1909,14 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
!cmSystemTools::IsSubDirectory(ri->c_str(), topSourceDir) &&
!cmSystemTools::IsSubDirectory(ri->c_str(), topBinaryDir))
{
- if(emitted.insert(*ri).second)
+ std::string d = *ri;
+ if (d.find(rootPath) == 0)
{
- runtimeDirs.push_back(*ri);
+ d = d.substr(rootPath.size());
+ }
+ if(emitted.insert(d).second)
+ {
+ runtimeDirs.push_back(d);
}
}
}