From c54ef80a4e44f630e01fac84e182dbdaf204131a Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Tue, 25 Jun 2019 16:28:27 +0200 Subject: CppTools: Ignore -f[no-]keep-inline-dllexport Fixes: QTCREATORBUG-22452 Change-Id: Ic17e6331e92f23c31f4f7319257f2d09c66af8a4 Reviewed-by: Cristian Adam Reviewed-by: David Schulz --- src/plugins/cpptools/compileroptionsbuilder.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/plugins/cpptools/compileroptionsbuilder.cpp') diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index c1cef62c6c..3d74ad8d32 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -709,6 +709,7 @@ void CompilerOptionsBuilder::evaluateCompilerFlags() qgetenv("QTC_CLANG_CMD_OPTIONS_BLACKLIST")) .split(';', QString::SkipEmptyParts); + const Core::Id &toolChain = m_projectPart.toolchainType; bool containsDriverMode = false; bool skipNext = false; for (const QString &option : m_projectPart.compilerFlags) { @@ -720,6 +721,13 @@ void CompilerOptionsBuilder::evaluateCompilerFlags() if (userBlackList.contains(option)) continue; + // TODO: Make it possible that the clang binary/driver ignores unknown options, + // as it is done for libclang/clangd (not checking for OPT_UNKNOWN). + if (toolChain == ProjectExplorer::Constants::MINGW_TOOLCHAIN_TYPEID) { + if (option == "-fkeep-inline-dllexport" || option == "-fno-keep-inline-dllexport") + continue; + } + // Ignore warning flags as these interfere with our user-configured diagnostics. // Note that once "-w" is provided, no warnings will be emitted, even if "-Wall" follows. if (m_useBuildSystemWarnings == UseBuildSystemWarnings::No @@ -772,7 +780,6 @@ void CompilerOptionsBuilder::evaluateCompilerFlags() m_compilerFlags.flags.append(theOption); } - const Core::Id &toolChain = m_projectPart.toolchainType; if (!containsDriverMode && (toolChain == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID || toolChain == ProjectExplorer::Constants::CLANG_CL_TOOLCHAIN_TYPEID)) { -- cgit v1.2.1