diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2019-10-11 14:56:16 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2019-10-22 11:46:56 +0000 |
commit | 90982bf2e2b7e68ec2810288424f036e22e4f278 (patch) | |
tree | 9656498e4f152bbca8b5ae547b01b7a49f0da9a6 /src/plugins/cpptools | |
parent | 8f6eb41cad805556779c2bac67bdbead68fffda1 (diff) | |
download | qt-creator-90982bf2e2b7e68ec2810288424f036e22e4f278.tar.gz |
Clang: Remove duplicated targets arguments
We always set the target explicitly (in a certain way), so exclude the
target arguments coming from the build system and the (possibly manually
specified) platform codegen flags of the toolchain.
Change-Id: I74bbec67f5960f05b50cf9c5aa11875c71a5161f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Diffstat (limited to 'src/plugins/cpptools')
-rw-r--r-- | src/plugins/cpptools/compileroptionsbuilder.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index f13f0f1a26..aafcd35b37 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -751,6 +751,16 @@ void CompilerOptionsBuilder::evaluateCompilerFlags() continue; } + // As we always set the target explicitly, filter out target args. + if (!m_projectPart.toolChainTargetTriple.isEmpty()) { + if (option.startsWith("--target=")) + continue; + if (option == "-target") { + skipNext = true; + continue; + } + } + if (option == includeUserPathOption || option == includeSystemPathOption || option == includeUserPathOptionWindows) { skipNext = true; |