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>
This commit is contained in:
Nikolai Kosjar
2019-10-11 14:56:16 +02:00
parent 8f6eb41cad
commit 90982bf2e2

View File

@@ -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;