summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/compileroptionsbuilder.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2019-02-12 09:46:25 +0100
committerNikolai Kosjar <nikolai.kosjar@qt.io>2019-02-12 09:50:21 +0000
commit9e57c5db5d034b383ba6d5879e7f5d01fff0bb40 (patch)
treeb15093809429d8b28a0f5a360dc5f600387dfc3d /src/plugins/cpptools/compileroptionsbuilder.cpp
parentd74ce63ac92edde8be2ce952d51a4db9d83ebef7 (diff)
downloadqt-creator-9e57c5db5d034b383ba6d5879e7f5d01fff0bb40.tar.gz
CppTools: Allow to black list command line flags from project
...for debugging and workarounds if necessary. Change-Id: If76cddb59fbd8e96f42d141bd5e5d03cd88ab30f Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'src/plugins/cpptools/compileroptionsbuilder.cpp')
-rw-r--r--src/plugins/cpptools/compileroptionsbuilder.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp
index 3f44a977c9..e5685dc5e0 100644
--- a/src/plugins/cpptools/compileroptionsbuilder.cpp
+++ b/src/plugins/cpptools/compileroptionsbuilder.cpp
@@ -41,6 +41,7 @@
#include <QDir>
#include <QRegularExpression>
+#include <QtGlobal>
namespace CppTools {
@@ -701,6 +702,10 @@ void CompilerOptionsBuilder::reset()
// QMakeProject: -pipe -Whello -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC
void CompilerOptionsBuilder::evaluateCompilerFlags()
{
+ static QStringList userBlackList = QString::fromLocal8Bit(
+ qgetenv("QTC_CLANG_CMD_OPTIONS_BLACKLIST"))
+ .split(';', QString::SkipEmptyParts);
+
bool containsDriverMode = false;
bool skipNext = false;
for (const QString &option : m_projectPart.compilerFlags) {
@@ -709,6 +714,9 @@ void CompilerOptionsBuilder::evaluateCompilerFlags()
continue;
}
+ if (userBlackList.contains(option))
+ 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