summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppprojects.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-11-17 16:21:13 +0100
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-11-23 14:22:24 +0000
commit6deaf6b23d76e0dded86a86f15940debc7598444 (patch)
tree15471e8afad292bf87b523db1f36953412880250 /src/plugins/cpptools/cppprojects.cpp
parentc88d18c310637a138b9f01b54151b1d7c8e3eb16 (diff)
downloadqt-creator-6deaf6b23d76e0dded86a86f15940debc7598444.tar.gz
CppTools: Guard against doubled header paths
Change-Id: If183b6d2210028f74dae839db782114ce79911c4 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com> Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Diffstat (limited to 'src/plugins/cpptools/cppprojects.cpp')
-rw-r--r--src/plugins/cpptools/cppprojects.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/plugins/cpptools/cppprojects.cpp b/src/plugins/cpptools/cppprojects.cpp
index d1ab05fb68..ba2b14ba0f 100644
--- a/src/plugins/cpptools/cppprojects.cpp
+++ b/src/plugins/cpptools/cppprojects.cpp
@@ -59,6 +59,16 @@ ProjectPart::ProjectPart()
{
}
+static ProjectPart::HeaderPath toProjectPartHeaderPath(const ProjectExplorer::HeaderPath &headerPath)
+{
+ const ProjectPart::HeaderPath::Type headerPathType =
+ headerPath.kind() == ProjectExplorer::HeaderPath::FrameworkHeaderPath
+ ? ProjectPart::HeaderPath::FrameworkPath
+ : ProjectPart::HeaderPath::IncludePath;
+
+ return ProjectPart::HeaderPath(headerPath.path(), headerPathType);
+}
+
/*!
\brief Retrieves info from concrete compiler using it's flags.
@@ -106,10 +116,9 @@ void ProjectPart::evaluateToolchain(const ToolChain *tc,
const QList<ProjectExplorer::HeaderPath> headers = tc->systemHeaderPaths(commandLineFlags, sysRoot);
foreach (const ProjectExplorer::HeaderPath &header, headers) {
- headerPaths << ProjectPart::HeaderPath(header.path(),
- header.kind() == ProjectExplorer::HeaderPath::FrameworkHeaderPath
- ? ProjectPart::HeaderPath::FrameworkPath
- : ProjectPart::HeaderPath::IncludePath);
+ const HeaderPath headerPath = toProjectPartHeaderPath(header);
+ if (!headerPaths.contains(headerPath))
+ headerPaths << headerPath;
}
toolchainDefines = tc->predefinedMacros(commandLineFlags);