Add system include path to HeaderPath and merge ProjectPartHeaderPath

System include paths are appended after other includes by the compiler. So
we should set them as system includes and not as normal includes. Otherwise
we change the include order. Headers in system include paths are not
cluttering the screen with unwanted warning and by the way improve
performance too.

ProjectPartHeaderPath was a dopperganger of HeaderPath, so we merged them.

Change-Id: I7c394b4098b697de79761499ffcd5913cc02d652
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Marco Bubke
2018-09-03 16:10:43 +02:00
parent 59e734d9da
commit 3abaf647d0
44 changed files with 237 additions and 320 deletions

View File

@@ -111,17 +111,6 @@ private:
languageExtensions |= ProjectPart::ObjectiveCExtensions;
}
static ProjectPartHeaderPath toProjectPartHeaderPath(
const ProjectExplorer::HeaderPath &headerPath)
{
const ProjectPartHeaderPath::Type headerPathType =
headerPath.kind() == ProjectExplorer::HeaderPath::FrameworkHeaderPath
? ProjectPartHeaderPath::FrameworkPath
: ProjectPartHeaderPath::IncludePath;
return ProjectPartHeaderPath(headerPath.path(), headerPathType);
}
void addHeaderPaths()
{
if (!m_tcInfo.headerPathsRunner)
@@ -131,9 +120,9 @@ private:
= m_tcInfo.headerPathsRunner(m_flags.commandLineFlags,
m_tcInfo.sysRootPath);
ProjectPartHeaderPaths &headerPaths = m_projectPart.headerPaths;
ProjectExplorer::HeaderPaths &headerPaths = m_projectPart.headerPaths;
for (const ProjectExplorer::HeaderPath &header : systemHeaderPaths) {
const ProjectPartHeaderPath headerPath = toProjectPartHeaderPath(header);
const ProjectExplorer::HeaderPath headerPath{header.path, header.type};
if (!headerPaths.contains(headerPath))
headerPaths.push_back(headerPath);
}