From 5fcdeb77270fb105f527ffd259d24ac8dd826d10 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 3 Mar 2016 17:38:19 +0100 Subject: CppTools: Apply has_include workaround also for a mingw toolchain Change-Id: Ib501b40870f71a552b0bd38fa4977b450fd37954 Reviewed-by: Christian Kandeler --- src/plugins/cpptools/compileroptionsbuilder.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/plugins/cpptools/compileroptionsbuilder.cpp') 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; -- cgit v1.2.1