summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/compileroptionsbuilder.cpp
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2018-09-17 11:29:32 +0200
committerIvan Donchevskii <ivan.donchevskii@qt.io>2018-09-17 11:24:32 +0000
commit0bd095aa4550eac51d026c96e5128720bf867a41 (patch)
tree3c9a36fc38b603884a8eabcb47c4511fceed91ad /src/plugins/cpptools/compileroptionsbuilder.cpp
parent3170d05087f3e1993bef1f9447a8bbd14a32a891 (diff)
downloadqt-creator-0bd095aa4550eac51d026c96e5128720bf867a41.tar.gz
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>
Diffstat (limited to 'src/plugins/cpptools/compileroptionsbuilder.cpp')
-rw-r--r--src/plugins/cpptools/compileroptionsbuilder.cpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp
index b0a5b5633e..38fa94e83d 100644
--- a/src/plugins/cpptools/compileroptionsbuilder.cpp
+++ b/src/plugins/cpptools/compileroptionsbuilder.cpp
@@ -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)