cmOrderDirectories: Factor out directory comparison
Create an `IsSameDirectory` helper method.
This commit is contained in:
parent
b4a2ada297
commit
6b18528743
@ -73,10 +73,8 @@ public:
|
|||||||
{
|
{
|
||||||
// Check if this directory conflicts with the entry.
|
// Check if this directory conflicts with the entry.
|
||||||
std::string const& dir = this->OD->OriginalDirectories[i];
|
std::string const& dir = this->OD->OriginalDirectories[i];
|
||||||
if(dir != this->Directory &&
|
if (!this->OD->IsSameDirectory(dir, this->Directory) &&
|
||||||
cmSystemTools::GetRealPath(dir) !=
|
this->FindConflict(dir))
|
||||||
cmSystemTools::GetRealPath(this->Directory) &&
|
|
||||||
this->FindConflict(dir))
|
|
||||||
{
|
{
|
||||||
// The library will be found in this directory but this is not
|
// The library will be found in this directory but this is not
|
||||||
// the directory named for it. Add an entry to make sure the
|
// the directory named for it. Add an entry to make sure the
|
||||||
@ -639,3 +637,10 @@ void cmOrderDirectories::DiagnoseCycle()
|
|||||||
->IssueMessage(cmake::WARNING, e.str(),
|
->IssueMessage(cmake::WARNING, e.str(),
|
||||||
this->Target->Target->GetBacktrace());
|
this->Target->Target->GetBacktrace());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool cmOrderDirectories::IsSameDirectory(std::string const& l,
|
||||||
|
std::string const& r)
|
||||||
|
{
|
||||||
|
return (l == r ||
|
||||||
|
cmSystemTools::GetRealPath(l) == cmSystemTools::GetRealPath(r));
|
||||||
|
}
|
||||||
|
@ -80,6 +80,9 @@ private:
|
|||||||
struct ConflictList: public std::vector<ConflictPair> {};
|
struct ConflictList: public std::vector<ConflictPair> {};
|
||||||
std::vector<ConflictList> ConflictGraph;
|
std::vector<ConflictList> ConflictGraph;
|
||||||
|
|
||||||
|
// Compare directories after resolving symlinks.
|
||||||
|
bool IsSameDirectory(std::string const& l, std::string const& r);
|
||||||
|
|
||||||
friend class cmOrderDirectoriesConstraint;
|
friend class cmOrderDirectoriesConstraint;
|
||||||
friend class cmOrderDirectoriesConstraintLibrary;
|
friend class cmOrderDirectoriesConstraintLibrary;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user