CppEditor: Transform deprecated -gcc-toolchain option

See https://reviews.llvm.org/D108494.

Change-Id: I85b2a0ea077d2a622fac16bda009a7ee71da0e90
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-11-02 13:23:20 +01:00
parent c13d828c99
commit 7e614b599e

View File

@@ -791,6 +791,7 @@ void CompilerOptionsBuilder::evaluateCompilerFlags()
bool containsDriverMode = false;
bool skipNext = false;
bool nextIsTarget = false;
bool nextIsGccToolchain = false;
const QStringList allFlags = m_projectPart.extraCodeModelFlags + m_projectPart.compilerFlags;
for (const QString &option : allFlags) {
if (skipNext) {
@@ -802,6 +803,11 @@ void CompilerOptionsBuilder::evaluateCompilerFlags()
m_explicitTarget = option;
continue;
}
if (nextIsGccToolchain) {
nextIsGccToolchain = false;
m_compilerFlags.flags.append("--gcc-toolchain=" + option);
continue;
}
if (userBlackList.contains(option))
continue;
@@ -833,6 +839,11 @@ void CompilerOptionsBuilder::evaluateCompilerFlags()
continue;
}
if (option == "-gcc-toolchain") {
nextIsGccToolchain = true;
continue;
}
if (option == includeUserPathOption || option == includeSystemPathOption
|| option == includeUserPathOptionWindows) {
skipNext = true;