Clang: Fix include paths order

C++ include paths should come before Clang include
folder. Therefore parse all options for include/c++/v1,
include/c++/{version}, include/g++ and /usr/local/include.

Task-number: QTCREATORBUG-20231
Change-Id: I22c41f07d241e1e564069bb192d4fe637ff05e87
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-08-23 15:45:33 +02:00
parent 4538227cb1
commit 1b4f5c0670
4 changed files with 132 additions and 64 deletions

View File

@@ -191,7 +191,10 @@ static AnalyzeUnits toAnalyzeUnits(const FileInfos &fileInfos)
AnalyzeUnits unitsToAnalyze;
const CompilerOptionsBuilder::PchUsage pchUsage = CppTools::getPchUsage();
for (const FileInfo &fileInfo : fileInfos) {
CompilerOptionsBuilder optionsBuilder(*fileInfo.projectPart);
CompilerOptionsBuilder optionsBuilder(*fileInfo.projectPart,
CppTools::UseSystemHeader::No,
QString(CLANG_VERSION),
QString(CLANG_RESOURCE_DIR));
QStringList arguments = extraClangToolsPrependOptions();
arguments.append(optionsBuilder.build(fileInfo.kind, pchUsage));
arguments.append(extraClangToolsAppendOptions());