diff --git a/lib/importproject.cpp b/lib/importproject.cpp index 03c61f3ec..51e583147 100644 --- a/lib/importproject.cpp +++ b/lib/importproject.cpp @@ -122,7 +122,12 @@ static bool simplifyPathWithVariables(std::string &s, const std::map &in, const std::map &variables) { std::list I; - for (std::list::const_iterator it = in.begin(); it != in.end(); ++it) { + // only parse each includePath once - so remove duplicates + std::list uniqueIncludePaths = in; + uniqueIncludePaths.sort(); + uniqueIncludePaths.unique(); + + for (std::list::const_iterator it = uniqueIncludePaths.begin(); it != uniqueIncludePaths.end(); ++it) { if (it->empty()) continue; if (it->compare(0,2,"%(")==0)