A patch update will be applied today - June 21st between 1pm - 1:45pm EDT (UTC-0400). GitLab will go down a few minutes within that time.

Commit c21db870 authored by David Cole's avatar David Cole
Browse files

Make search paths ordered and unique

Avoid duplicates. Same as before the introduction of the INCLUDE_DIRECTORIES
target property.
parent 22021f07
......@@ -56,6 +56,8 @@ void cmMakeDepend::SetMakefile(cmMakefile* makefile)
this->Makefile->ComplainFileRegularExpression.c_str());
// Now extract any include paths from the targets
std::set<std::string> uniqueIncludes;
std::vector<std::string> orderedAndUniqueIncludes;
cmTargets & targets = this->Makefile->GetTargets();
for (cmTargets::iterator l = targets.begin(); l != targets.end(); ++l)
{
......@@ -66,9 +68,20 @@ void cmMakeDepend::SetMakefile(cmMakefile* makefile)
{
std::string path = *j;
this->Makefile->ExpandVariablesInString(path);
this->AddSearchPath(path.c_str());
if(uniqueIncludes.insert(path).second)
{
orderedAndUniqueIncludes.push_back(path);
}
}
}
for(std::vector<std::string>::const_iterator
it = orderedAndUniqueIncludes.begin();
it != orderedAndUniqueIncludes.end();
++it)
{
this->AddSearchPath(it->c_str());
}
}
......
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