forked from qt-creator/qt-creator
Clang: Take precompiled headers into account when parsing source files
Task-number: QTCREATORBUG-15590 Change-Id: Icbfce4ffd6e9f9802641d35d898fa1dc1c4c18ee Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
committed by
Nikolai Kosjar
parent
569f4499c0
commit
36d4d01cd3
@@ -401,9 +401,30 @@ static QStringList warningOptions(CppTools::ProjectPart *projectPart)
|
||||
return CppTools::codeModelSettings()->clangDiagnosticConfig().commandLineOptions();
|
||||
}
|
||||
|
||||
static QStringList precompiledHeaderOptions(
|
||||
const QString& filePath,
|
||||
CppTools::ProjectPart *projectPart)
|
||||
{
|
||||
using namespace CppTools;
|
||||
|
||||
if (CppTools::getPchUsage() == CompilerOptionsBuilder::PchUsage::None)
|
||||
return QStringList();
|
||||
|
||||
if (projectPart->precompiledHeaders.contains(filePath))
|
||||
return QStringList();
|
||||
|
||||
const CppTools::ProjectPart theProjectPart = projectPartForLanguageOption(projectPart);
|
||||
CppTools::CompilerOptionsBuilder builder(theProjectPart);
|
||||
builder.addPrecompiledHeaderOptions(CompilerOptionsBuilder::PchUsage::Use);
|
||||
|
||||
return builder.options();
|
||||
}
|
||||
|
||||
static QStringList fileArguments(const QString &filePath, CppTools::ProjectPart *projectPart)
|
||||
{
|
||||
return languageOptions(filePath, projectPart) + warningOptions(projectPart);
|
||||
return languageOptions(filePath, projectPart)
|
||||
+ warningOptions(projectPart)
|
||||
+ precompiledHeaderOptions(filePath, projectPart);
|
||||
}
|
||||
|
||||
ClangBackEnd::FileContainer
|
||||
|
||||
Reference in New Issue
Block a user