forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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.
|
\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);
|
const QList<ProjectExplorer::HeaderPath> headers = tc->systemHeaderPaths(commandLineFlags, sysRoot);
|
||||||
foreach (const ProjectExplorer::HeaderPath &header, headers) {
|
foreach (const ProjectExplorer::HeaderPath &header, headers) {
|
||||||
headerPaths << ProjectPart::HeaderPath(header.path(),
|
const HeaderPath headerPath = toProjectPartHeaderPath(header);
|
||||||
header.kind() == ProjectExplorer::HeaderPath::FrameworkHeaderPath
|
if (!headerPaths.contains(headerPath))
|
||||||
? ProjectPart::HeaderPath::FrameworkPath
|
headerPaths << headerPath;
|
||||||
: ProjectPart::HeaderPath::IncludePath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
toolchainDefines = tc->predefinedMacros(commandLineFlags);
|
toolchainDefines = tc->predefinedMacros(commandLineFlags);
|
||||||
|
Reference in New Issue
Block a user