ProjectExplorer: Rename compiler includes from System to BuiltIn

System include are those used with -isystem keyword, built-in
includes on the other hand come from compiler and always
follow in the end of the include list (after system includes).

Change-Id: I95c2fec36d2e5b43f014fe0a88d59c6769edfa1f
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-09-17 11:29:32 +02:00
parent 3170d05087
commit 0bd095aa45
21 changed files with 89 additions and 80 deletions

View File

@@ -200,7 +200,9 @@ void CompilerOptionsBuilder::addHeaderPathOptions()
{
using ProjectExplorer::HeaderPathType;
QStringList result;
QStringList includes;
QStringList systemIncludes;
QStringList builtInIncludes;
for (const ProjectExplorer::HeaderPath &headerPath : qAsConst(m_projectPart.headerPaths)) {
if (headerPath.path.isEmpty())
@@ -209,29 +211,33 @@ void CompilerOptionsBuilder::addHeaderPathOptions()
if (excludeHeaderPath(headerPath.path))
continue;
QString prefix;
Utils::FileName path;
switch (headerPath.type) {
case HeaderPathType::Framework:
prefix = QLatin1String("-F");
break;
case HeaderPathType::System:
prefix = m_useSystemHeader == UseSystemHeader::No
? QLatin1String("-I")
: QLatin1String("-isystem");
includes.append("-F");
includes.append(QDir::toNativeSeparators(headerPath.path));
break;
default: // This shouldn't happen, but let's be nice..:
// intentional fall-through:
case HeaderPathType::User:
prefix = includeDirOptionForPath(headerPath.path);
includes.append(includeDirOptionForPath(headerPath.path));
includes.append(QDir::toNativeSeparators(headerPath.path));
break;
case HeaderPathType::BuiltIn:
builtInIncludes.append("-isystem");
builtInIncludes.append(QDir::toNativeSeparators(headerPath.path));
break;
case HeaderPathType::System:
systemIncludes.append(m_useSystemHeader == UseSystemHeader::No
? QLatin1String("-I")
: QLatin1String("-isystem"));
systemIncludes.append(QDir::toNativeSeparators(headerPath.path));
break;
}
result.append(prefix);
result.append(QDir::toNativeSeparators(headerPath.path));
}
m_options.append(result);
m_options.append(includes);
m_options.append(systemIncludes);
m_options.append(builtInIncludes);
}
void CompilerOptionsBuilder::addPrecompiledHeaderOptions(PchUsage pchUsage)