summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-03 12:57:29 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2017-03-03 12:57:29 (GMT)
commit24c0e229efd92392a877ba5c7c52d74fb9fdf689 (patch)
tree4f6720f87ee7314d1b71da5942c12a8c22704653 /Source
parent1e0841c67244c70641a18c348cd8a274f4789010 (diff)
parent69528fe65f0c4402c6560917d6cb118d2c103445 (diff)
downloadCMake-24c0e229efd92392a877ba5c7c52d74fb9fdf689.zip
CMake-24c0e229efd92392a877ba5c7c52d74fb9fdf689.tar.gz
CMake-24c0e229efd92392a877ba5c7c52d74fb9fdf689.tar.bz2
Merge topic 'implicit-dir-symlinks'
69528fe6 Tests: Add case for RPATH exclusion of symlinks to implicit directories f3102ca8 Merge branch 'backport-implicit-dir-symlinks' into implicit-dir-symlinks c3fb650c cmOrderDirectories: Consider symlinks when checking implicit directories b1a37362 cmOrderDirectories: Factor out implicit directory check
Diffstat (limited to 'Source')
-rw-r--r--Source/cmOrderDirectories.cxx22
-rw-r--r--Source/cmOrderDirectories.h2
2 files changed, 17 insertions, 7 deletions
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx
index 7744a5a..d48eb53 100644
--- a/Source/cmOrderDirectories.cxx
+++ b/Source/cmOrderDirectories.cxx
@@ -287,8 +287,7 @@ void cmOrderDirectories::AddRuntimeLibrary(std::string const& fullPath,
}
}
- if (this->ImplicitDirectories.find(dir) !=
- this->ImplicitDirectories.end()) {
+ if (this->IsImplicitDirectory(dir)) {
this->ImplicitDirEntries.push_back(
new cmOrderDirectoriesConstraintSOName(this, fullPath, soname));
return;
@@ -316,8 +315,7 @@ void cmOrderDirectories::AddLinkLibrary(std::string const& fullPath)
// Implicit link directories need special handling.
if (!this->ImplicitDirectories.empty()) {
std::string dir = cmSystemTools::GetFilenamePath(fullPath);
- if (this->ImplicitDirectories.find(dir) !=
- this->ImplicitDirectories.end()) {
+ if (this->IsImplicitDirectory(dir)) {
this->ImplicitDirEntries.push_back(
new cmOrderDirectoriesConstraintLibrary(this, fullPath));
return;
@@ -347,7 +345,18 @@ void cmOrderDirectories::AddLanguageDirectories(
void cmOrderDirectories::SetImplicitDirectories(
std::set<std::string> const& implicitDirs)
{
- this->ImplicitDirectories = implicitDirs;
+ this->ImplicitDirectories.clear();
+ for (std::set<std::string>::const_iterator i = implicitDirs.begin();
+ i != implicitDirs.end(); ++i) {
+ this->ImplicitDirectories.insert(this->GetRealPath(*i));
+ }
+}
+
+bool cmOrderDirectories::IsImplicitDirectory(std::string const& dir)
+{
+ std::string const& real = this->GetRealPath(dir);
+ return this->ImplicitDirectories.find(real) !=
+ this->ImplicitDirectories.end();
}
void cmOrderDirectories::SetLinkExtensionInfo(
@@ -394,8 +403,7 @@ void cmOrderDirectories::AddOriginalDirectories(
for (std::vector<std::string>::const_iterator di = dirs.begin();
di != dirs.end(); ++di) {
// We never explicitly specify implicit link directories.
- if (this->ImplicitDirectories.find(*di) !=
- this->ImplicitDirectories.end()) {
+ if (this->IsImplicitDirectory(*di)) {
continue;
}
diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h
index 90a67e7..d9e0126 100644
--- a/Source/cmOrderDirectories.h
+++ b/Source/cmOrderDirectories.h
@@ -82,6 +82,8 @@ private:
// Compare directories after resolving symlinks.
bool IsSameDirectory(std::string const& l, std::string const& r);
+ bool IsImplicitDirectory(std::string const& dir);
+
std::string const& GetRealPath(std::string const& dir);
std::map<std::string, std::string> RealPaths;