build: Add --disable-Werror

We enable a bunch of compiler flags to trip common errors during
development. While this is very useful while hacking on Clutter, it
makes the life of people building Clutter on automated build systems
much harder; thus, we should have a configuration option to opt out of
the -Werror business.

GNOME has pretty much standardised on `--disable-Werror`, so we should
crib that configure option.
This commit is contained in:
Emmanuele Bassi 2015-11-30 13:15:52 +00:00
parent 2646658bf2
commit 3b6ed43edd

View File

@ -955,7 +955,15 @@ MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS
-Wcast-align -Wcast-align
-Wuninitialized -Wuninitialized
-Wno-strict-aliasing -Wno-strict-aliasing
-Wshadow -Wshadow"
AC_ARG_ENABLE([Werror],
[AS_HELP_STRING([--disable-Werror], [Removes -Werror from compiler flags])],
[],
[enable_Werror=yes])
AS_IF([test "x$enable_Werror" = xyes], [
MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS
-Werror=logical-op -Werror=logical-op
-Werror=pointer-arith -Werror=pointer-arith
-Werror=missing-declarations -Werror=missing-declarations
@ -967,6 +975,7 @@ MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS
-Werror=init-self -Werror=init-self
-Werror=declaration-after-statement -Werror=declaration-after-statement
-Werror=vla" -Werror=vla"
])
AS_CASE([$enable_maintainer_flags], AS_CASE([$enable_maintainer_flags],
[yes], [yes],