Clang: Suppress GCC warning with LLVM 7.0.1

Change-Id: I6de160b42472560a3b33d9a3390b0890eabe9d44
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Orgad Shaneh
2018-12-18 22:45:10 +02:00
committed by Orgad Shaneh
parent cd50fe826d
commit 2379007c17
2 changed files with 4 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ Module {
property stringList hostOS: qbs.hostOS
property stringList targetOS: qbs.targetOS
property stringList toolchain: qbs.toolchain
property string llvmConfig
property string llvmVersion
@@ -38,6 +39,8 @@ Module {
llvmToolingDefines = toolingParams.defines;
llvmToolingIncludes = toolingParams.includes;
llvmToolingCxxFlags = toolingParams.cxxFlags;
if (toolchain.contains("gcc"))
res.push("-Wno-unused-parameter");
llvmFormattingLibs = ClangFunctions.formattingLibs(llvmConfig, QtcFunctions, targetOS);
found = llvmConfig && File.exists(llvmIncludeDir.concat("/clang-c/Index.h"));
}

View File

@@ -177,6 +177,7 @@ isEmpty(LLVM_VERSION) {
GCC_MAJOR_VERSION = $$section(GCC_VERSION, ., 0, 0)
# GCC8 warns about memset/memcpy for types with copy ctor. Clang has some of these.
greaterThan(GCC_MAJOR_VERSION, 7):QMAKE_CXXFLAGS += -Wno-class-memaccess
QMAKE_CXXFLAGS += -Wno-unused-parameter
}
LLVM_LIBDIR = $$quote($$system($$llvm_config --libdir, lines))