only use each include path once

This commit is contained in:
x29a 2017-06-22 16:49:36 +02:00
parent 947ace6194
commit cde17935ea
1 changed files with 6 additions and 1 deletions

View File

@ -122,7 +122,12 @@ static bool simplifyPathWithVariables(std::string &s, const std::map<std::string
void ImportProject::FileSettings::setIncludePaths(const std::string &basepath, const std::list<std::string> &in, const std::map<std::string, std::string> &variables) void ImportProject::FileSettings::setIncludePaths(const std::string &basepath, const std::list<std::string> &in, const std::map<std::string, std::string> &variables)
{ {
std::list<std::string> I; std::list<std::string> I;
for (std::list<std::string>::const_iterator it = in.begin(); it != in.end(); ++it) { // only parse each includePath once - so remove duplicates
std::list<std::string> uniqueIncludePaths = in;
uniqueIncludePaths.sort();
uniqueIncludePaths.unique();
for (std::list<std::string>::const_iterator it = uniqueIncludePaths.begin(); uniqueIncludePaths != in.end(); ++it) {
if (it->empty()) if (it->empty())
continue; continue;
if (it->compare(0,2,"%(")==0) if (it->compare(0,2,"%(")==0)