Commit b1a37362 authored by Brad King's avatar Brad King
Browse files

cmOrderDirectories: Factor out implicit directory check

parent 2b1cdd85
......@@ -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;
......@@ -350,6 +348,12 @@ void cmOrderDirectories::SetImplicitDirectories(
this->ImplicitDirectories = implicitDirs;
}
bool cmOrderDirectories::IsImplicitDirectory(std::string const& dir)
{
return this->ImplicitDirectories.find(dir) !=
this->ImplicitDirectories.end();
}
void cmOrderDirectories::SetLinkExtensionInfo(
std::vector<std::string> const& linkExtensions,
std::string const& removeExtRegex)
......@@ -394,8 +398,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;
}
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment