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
@@ -112,7 +112,7 @@ void CompilerOptionsBuilder::enableExceptions()
|
||||
void CompilerOptionsBuilder::addHeaderPathOptions()
|
||||
{
|
||||
typedef ProjectPartHeaderPath HeaderPath;
|
||||
const QString defaultPrefix = includeOption();
|
||||
const QString defaultPrefix = includeDirOption();
|
||||
|
||||
QStringList result;
|
||||
|
||||
@@ -141,6 +141,24 @@ void CompilerOptionsBuilder::addHeaderPathOptions()
|
||||
m_options.append(result);
|
||||
}
|
||||
|
||||
void CompilerOptionsBuilder::addPrecompiledHeaderOptions(PchUsage pchUsage)
|
||||
{
|
||||
if (pchUsage == PchUsage::None)
|
||||
return;
|
||||
|
||||
QStringList result;
|
||||
|
||||
const QString includeOptionString = includeOption();
|
||||
foreach (const QString &pchFile, m_projectPart.precompiledHeaders) {
|
||||
if (QFile::exists(pchFile)) {
|
||||
result += includeOptionString;
|
||||
result += QDir::toNativeSeparators(pchFile);
|
||||
}
|
||||
}
|
||||
|
||||
m_options.append(result);
|
||||
}
|
||||
|
||||
void CompilerOptionsBuilder::addToolchainAndProjectDefines()
|
||||
{
|
||||
addDefines(m_projectPart.toolchainDefines);
|
||||
@@ -376,7 +394,7 @@ void CompilerOptionsBuilder::addDefineFloat128ForMingw()
|
||||
addDefine("#define __float128 void");
|
||||
}
|
||||
|
||||
QString CompilerOptionsBuilder::includeOption() const
|
||||
QString CompilerOptionsBuilder::includeDirOption() const
|
||||
{
|
||||
return QLatin1String("-I");
|
||||
}
|
||||
@@ -399,6 +417,11 @@ QString CompilerOptionsBuilder::undefineOption() const
|
||||
return QLatin1String("-U");
|
||||
}
|
||||
|
||||
QString CompilerOptionsBuilder::includeOption() const
|
||||
{
|
||||
return QLatin1String("-include");
|
||||
}
|
||||
|
||||
static bool isGccOrMinGwToolchain(const Core::Id &toolchainType)
|
||||
{
|
||||
return toolchainType == ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID
|
||||
|
||||
Reference in New Issue
Block a user