From 701d8fdb363443453c4b613e9180f75ad36a7321 Mon Sep 17 00:00:00 2001 From: marius vlad Date: Tue, 10 May 2016 17:32:15 +0300 Subject: benchmarks/, overlay/, demos/, tools/, tests/: Add optional Werror. v2: Initially added Werror by default. Make it optional so it doesn't break android build and (potential) distros maintaing the package (Hinted by Damien Lespiau). --enable-werror will enable -Werror compiler flag. Signed-off-by: Marius Vlad Acked-by: Damien Lespiau --- configure.ac | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 05897820..11b1d46a 100644 --- a/configure.ac +++ b/configure.ac @@ -229,6 +229,11 @@ AC_ARG_ENABLE(debug, [Build tests without debug symbols]), [], [enable_debug=yes]) +AC_ARG_ENABLE(werror, + AS_HELP_STRING([--enable-werror], + [Fail on warnings]), + [], [enable_werror=no]) + if test "x$enable_debug" = xyes; then AS_COMPILER_FLAG([-g3], [DEBUG_CFLAGS="-g3"], [DEBUG_CFLAGS="-g"]) AS_COMPILER_FLAG([-Og], [DEBUG_CFLAGS+=" -Og -Wno-maybe-uninitialized"], # disable maybe-uninitialized due to false positives @@ -236,6 +241,10 @@ if test "x$enable_debug" = xyes; then AC_SUBST([DEBUG_CFLAGS]) fi +if test "x$enable_werror" = xyes; then + AS_COMPILER_FLAG([-Werror], [WERROR_CFLAGS="-Werror"]) +fi + # prevent relinking the world on every commit for developers AC_ARG_ENABLE(git-hash, AS_HELP_STRING([--disable-git-hash], @@ -313,6 +322,7 @@ echo " Overlay : X: ${enable_overlay_xlib}, Xv: ${enable_overla echo " x86-specific tools : ${build_x86}" echo "" echo " • API-Documentation : ${enable_gtk_doc}" +echo " • Fail on warnings: : ${enable_werror}" echo "" # vim: set ft=config ts=8 sw=8 tw=0 noet : -- cgit v1.2.3