summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-02-14 16:28:53 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-02-14 19:24:32 +0100
commitbce14e97a6dad7686643d094995433c77e4aee7e (patch)
tree1946fc03d5c062ae2fe77657b2847c42628e4cbf /compilerplugins
parent62ac8333999c661432adb0a18245a399daa89dcb (diff)
Prevent -Werror,-Wunknown-warning-option when building compilerplugins
...with --enable-werror (seen it fail with a local build against a locally built Clang 5.0.2). (bin/gen-boost-headers faces a similar dilemma with Clang needing to silence -Wunknown-warning-option and GCC failing upon the silencing incantation. There, we were able to hack around that with a preceding #pragma GCC diagnostic ignored "-Wpragmas" Here, the easiest approach appears to be a new COMPILER_PLUGINS_COM_IS_CLANG analoguous to the existing COM_IS_CLANG.) Change-Id: I9036261fdd238c8a020a1d88b4e75fd444f9e030 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88725 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/Makefile-clang.mk8
1 files changed, 8 insertions, 0 deletions
diff --git a/compilerplugins/Makefile-clang.mk b/compilerplugins/Makefile-clang.mk
index 543ec27aad44..266919cf02b8 100644
--- a/compilerplugins/Makefile-clang.mk
+++ b/compilerplugins/Makefile-clang.mk
@@ -101,6 +101,14 @@ CLANGWERROR :=
#TODO: /WX
else
CLANGWERROR := -Werror
+# When COMPILER_PLUGINS_CXXFLAGS (obtained via `llvm-config --cxxflags`) contains options like
+# -Wno-maybe-uninitialized that are targeting GCC (when LLVM was actually built with GCC), and
+# COMPILER_PLUGINS_CXX (defaulting to CXX) deonotes a Clang that does not understand those options,
+# it fails with -Werror,-Wunknown-warning-option, so we need -Wno-unknown-warning-option (but which
+# GCC does not understand) at least with -Werror:
+ifeq ($(COMPILER_PLUGINS_COM_IS_CLANG),TRUE)
+CLANGWERROR += -Wno-unknown-warning-option
+endif
endif
endif