ProjectExplorer: Fix handling of -Xclang when filtering compiler flags

Amends fd47b37298.

Change-Id: Idb78ebb88291d26498a5bfd7301fdc721fc6a6f7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2024-01-22 16:13:34 +01:00
parent 6d7387f1aa
commit f68a0ca738

View File

@@ -483,6 +483,7 @@ static QStringList filteredFlags(const QStringList &allFlags, bool considerSysro
filtered << a << allFlags.at(i);
} else if (a == "-Xclang") {
filtered << a;
continue;
} else if ((considerSysroot && (a == "--sysroot" || a == "-isysroot"))
|| a == "-D" || a == "-U"
|| a == "-gcc-toolchain" || a == "-target" || a == "-mllvm" || a == "-isystem") {
@@ -499,6 +500,8 @@ static QStringList filteredFlags(const QStringList &allFlags, bool considerSysro
|| a == "-nostdinc" || a == "-nostdinc++") {
filtered << a;
}
if (!filtered.isEmpty() && filtered.last() == "-Xclang")
filtered.removeLast();
}
return filtered;
}