summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/compileroptionsbuilder.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2016-03-03 17:38:19 +0100
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2016-03-04 09:53:59 +0000
commit5fcdeb77270fb105f527ffd259d24ac8dd826d10 (patch)
tree7c56fda00ada32ea883d1ec24cfe223462113662 /src/plugins/cpptools/compileroptionsbuilder.cpp
parentef1106a27fa15761f4acd17127ffefdbe01adf31 (diff)
downloadqt-creator-5fcdeb77270fb105f527ffd259d24ac8dd826d10.tar.gz
CppTools: Apply has_include workaround also for a mingw toolchain
Change-Id: Ib501b40870f71a552b0bd38fa4977b450fd37954 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'src/plugins/cpptools/compileroptionsbuilder.cpp')
-rw-r--r--src/plugins/cpptools/compileroptionsbuilder.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp
index e4d63da227..c484e2b185 100644
--- a/src/plugins/cpptools/compileroptionsbuilder.cpp
+++ b/src/plugins/cpptools/compileroptionsbuilder.cpp
@@ -227,6 +227,12 @@ QString CompilerOptionsBuilder::defineOption() const
return QLatin1String("-D");
}
+static bool isGccOrMinGwToolchain(const Core::Id &toolchainType)
+{
+ return toolchainType == ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID
+ || toolchainType == ProjectExplorer::Constants::MINGW_TOOLCHAIN_TYPEID;
+}
+
bool CompilerOptionsBuilder::excludeDefineLine(const QByteArray &defineLine) const
{
// This is a quick fix for QTCREATORBUG-11501.
@@ -240,8 +246,7 @@ bool CompilerOptionsBuilder::excludeDefineLine(const QByteArray &defineLine) con
// The right-hand sides are gcc built-ins that clang does not understand, and they'd
// override clang's own (non-macro, it seems) definitions of the symbols on the left-hand
// side.
- const bool isGccToolchain = m_projectPart.toolchainType == ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID;
- if (isGccToolchain && defineLine.contains("has_include"))
+ if (isGccOrMinGwToolchain(m_projectPart.toolchainType) && defineLine.contains("has_include"))
return true;
return false;