From bce14e97a6dad7686643d094995433c77e4aee7e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 14 Feb 2020 16:28:53 +0100 Subject: 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 --- configure.ac | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 3fa8fc760e3f..e186f6d3eb73 100644 --- a/configure.ac +++ b/configure.ac @@ -7218,6 +7218,7 @@ if test "$COM_IS_CLANG" != "TRUE"; then fi fi +COMPILER_PLUGINS_COM_IS_CLANG= if test "$COM_IS_CLANG" = "TRUE"; then if test -n "$enable_compiler_plugins"; then compiler_plugins="$enable_compiler_plugins" @@ -7336,6 +7337,18 @@ if test "$COM_IS_CLANG" = "TRUE"; then LDFLAGS=$save_LDFLAGS LIBS="$save_LIBS" AC_LANG_POP([C++]) + + AC_MSG_CHECKING([whether the compiler for building compilerplugins is actually Clang]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + #ifndef __clang__ + you lose + #endif + int foo=42; + ]])], + [AC_MSG_RESULT([yes]) + COMPILER_PLUGINS_COM_IS_CLANG=TRUE], + [AC_MSG_RESULT([no])]) + AC_SUBST(COMPILER_PLUGINS_COM_IS_CLANG) fi else if test "$enable_compiler_plugins" = "yes"; then @@ -7343,6 +7356,7 @@ else fi fi AC_SUBST(COMPILER_PLUGINS) +AC_SUBST(COMPILER_PLUGINS_COM_IS_CLANG) AC_SUBST(COMPILER_PLUGINS_CXX) AC_SUBST(COMPILER_PLUGINS_CXXFLAGS) AC_SUBST(COMPILER_PLUGINS_CXX_LINKFLAGS) -- cgit