From 3b6ed43edd46b46e115d9d3fdc98d0d9e92857f6 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 30 Nov 2015 13:15:52 +0000 Subject: [PATCH] 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. --- configure.ac | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 3640492d5..a6fc6cd98 100644 --- a/configure.ac +++ b/configure.ac @@ -955,18 +955,27 @@ MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Wcast-align -Wuninitialized -Wno-strict-aliasing - -Wshadow - -Werror=logical-op - -Werror=pointer-arith - -Werror=missing-declarations - -Werror=redundant-decls - -Werror=empty-body - -Werror=format - -Werror=format-security - -Werror=format-nonliteral - -Werror=init-self - -Werror=declaration-after-statement - -Werror=vla" + -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=pointer-arith + -Werror=missing-declarations + -Werror=redundant-decls + -Werror=empty-body + -Werror=format + -Werror=format-security + -Werror=format-nonliteral + -Werror=init-self + -Werror=declaration-after-statement + -Werror=vla" +]) AS_CASE([$enable_maintainer_flags], [yes],