From d08e5c33ff7b1d14be5e679eae5c9e2641fcc020 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 4 May 2020 12:49:57 +0200 Subject: [PATCH] Qbs build: Suppress excessive warnings from Qt with clang 10 We get these thousands of times: /usr/include/qt/QtCore/qbytearray.h:586: warning: definition of implicit copy constructor for 'QByteRef' is deprecated because it has a user- declared copy assignment operator [-Wdeprecated-copy] inline QByteRef &operator=(const QByteRef &c) ^ /usr/include/qt/QtCore/5.14.2/QtCore/private/qmetatype_p.h:111: warning: use of logical '||' with constant operand [-Wconstant-logical-operand] Change-Id: I5f97f23d9b62ef1cd8d07495c46598d2a34a6d85 Reviewed-by: Christian Stenger --- qbs/imports/QtcProduct.qbs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qbs/imports/QtcProduct.qbs b/qbs/imports/QtcProduct.qbs index e54dc667f4a..862c8247433 100644 --- a/qbs/imports/QtcProduct.qbs +++ b/qbs/imports/QtcProduct.qbs @@ -36,6 +36,11 @@ Product { cpp.cxxFlags: { var flags = []; + if (qbs.toolchain.contains("clang") + && Utilities.versionCompare(cpp.compilerVersion, "10") >= 0) { + // Triggers a lot in Qt. + flags.push("-Wno-deprecated-copy", "-Wno-constant-logical-operand"); + } if (qbs.toolchain.contains("gcc") && !qbs.toolchain.contains("clang")) { flags.push("-Wno-noexcept-type"); if (Utilities.versionCompare(cpp.compilerVersion, "9") >= 0)