qbs build: Take differences between clang and "apple clang" into account

In particular, clang with version number 10 is not really clang 10 on
macOS.

Change-Id: I8be489fa9cffd63c1ea8f13d181686ab1a575ec6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2020-05-11 11:38:33 +02:00
parent 99b66f6238
commit 8e1169f4bf
2 changed files with 2 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ Product {
cpp.cxxFlags: { cpp.cxxFlags: {
var flags = []; var flags = [];
if (qbs.toolchain.contains("clang") if (qbs.toolchain.contains("clang")
&& !qbs.hostOS.contains("darwin")
&& Utilities.versionCompare(cpp.compilerVersion, "10") >= 0) { && Utilities.versionCompare(cpp.compilerVersion, "10") >= 0) {
// Triggers a lot in Qt. // Triggers a lot in Qt.
flags.push("-Wno-deprecated-copy", "-Wno-constant-logical-operand"); flags.push("-Wno-deprecated-copy", "-Wno-constant-logical-operand");

View File

@@ -15,6 +15,7 @@ DynamicLibrary {
cpp.cxxFlags: { cpp.cxxFlags: {
var flags = []; var flags = [];
if (qbs.toolchain.contains("clang") if (qbs.toolchain.contains("clang")
&& !qbs.hostOS.contains("darwin")
&& Utilities.versionCompare(cpp.compilerVersion, "10") >= 0) { && Utilities.versionCompare(cpp.compilerVersion, "10") >= 0) {
// Triggers a lot in Qt. // Triggers a lot in Qt.
flags.push("-Wno-deprecated-copy", "-Wno-constant-logical-operand"); flags.push("-Wno-deprecated-copy", "-Wno-constant-logical-operand");