summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-04-13 12:46:57 (GMT)
committerBrad King <brad.king@kitware.com>2013-11-19 17:39:39 (GMT)
commit7cd65c97fabd9f3249739a81dd1260a1e0b59ee1 (patch)
tree27ba5ee0d30c9a59ed288806ca1ce40060dd4f0f /Source/cmComputeLinkInformation.cxx
parent5096967ecd443f3d7477d823e7ffdffcc15a8ed1 (diff)
downloadCMake-7cd65c97fabd9f3249739a81dd1260a1e0b59ee1.zip
CMake-7cd65c97fabd9f3249739a81dd1260a1e0b59ee1.tar.gz
CMake-7cd65c97fabd9f3249739a81dd1260a1e0b59ee1.tar.bz2
Add CMAKE_SYSROOT variable to set --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.cxx20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index d4644c3..3152c2a 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1901,6 +1901,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)
@@ -1909,9 +1911,14 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
// support or if using the link path as an rpath.
if(use_build_rpath)
{
- if(emitted.insert(*ri).second)
+ std::string d = *ri;
+ if (!rootPath.empty() && d.find(rootPath) == 0)
{
- runtimeDirs.push_back(*ri);
+ d = d.substr(rootPath.size());
+ }
+ if(emitted.insert(d).second)
+ {
+ runtimeDirs.push_back(d);
}
}
else if(use_link_rpath)
@@ -1924,9 +1931,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 (!rootPath.empty() && d.find(rootPath) == 0)
+ {
+ d = d.substr(rootPath.size());
+ }
+ if(emitted.insert(d).second)
{
- runtimeDirs.push_back(*ri);
+ runtimeDirs.push_back(d);
}
}
}