forked from qt-creator/qt-creator
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:
@@ -198,11 +198,11 @@ void CompilerOptionsBuilder::enableExceptions()
|
||||
|
||||
void CompilerOptionsBuilder::addHeaderPathOptions()
|
||||
{
|
||||
typedef ProjectPartHeaderPath HeaderPath;
|
||||
using ProjectExplorer::IncludePathType;
|
||||
|
||||
QStringList result;
|
||||
|
||||
foreach (const HeaderPath &headerPath , m_projectPart.headerPaths) {
|
||||
for (const ProjectExplorer::HeaderPath &headerPath : qAsConst(m_projectPart.headerPaths)) {
|
||||
if (headerPath.path.isEmpty())
|
||||
continue;
|
||||
|
||||
@@ -212,12 +212,15 @@ void CompilerOptionsBuilder::addHeaderPathOptions()
|
||||
QString prefix;
|
||||
Utils::FileName path;
|
||||
switch (headerPath.type) {
|
||||
case HeaderPath::FrameworkPath:
|
||||
case IncludePathType::Framework:
|
||||
prefix = QLatin1String("-F");
|
||||
break;
|
||||
case IncludePathType::System:
|
||||
prefix = "-isystem";
|
||||
break;
|
||||
default: // This shouldn't happen, but let's be nice..:
|
||||
// intentional fall-through:
|
||||
case HeaderPath::IncludePath:
|
||||
case IncludePathType::User:
|
||||
prefix = includeDirOptionForPath(headerPath.path);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user