configure.ac |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 58d472b73c3f05eecabaa25e0d76287219556f4c
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Thu Feb 8 15:27:12 2018 +0100

    configure: allow disable werror with --disable-werror
    
    Change-Id: Ie614ce2143669008c38ecf4b267d6fec78337be6
    Reviewed-on: https://gerrit.libreoffice.org/49434
    Reviewed-by: Aron Budea <aron.bu...@collabora.com>
    Tested-by: Aron Budea <aron.bu...@collabora.com>
    (cherry picked from commit b8926baa1809300410783fc9991a02162767a374)
    Reviewed-on: https://gerrit.libreoffice.org/49440
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>
    Tested-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/configure.ac b/configure.ac
index d3cefbb7..94d05087 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,6 +113,10 @@ AC_ARG_WITH([compiler-plugins],
                 [Experimental! Unlikely to work for anyone except Noel! Enable 
compiler plugins that will perform additional checks during
                  building.]))
 
+AC_ARG_ENABLE([werror],
+            AS_HELP_STRING([--disable-werror],
+                          [Do not turn warnings into errors.]))
+
 # Handle options
 AS_IF([test "$enable_debug" = yes -a -n "$with_poco_libs"],
       [POCO_DEBUG_SUFFIX=d],
@@ -166,8 +170,17 @@ AC_SUBST(MAX_DOCUMENTS)
 # Test for build environment
 
 CXXFLAGS="$CXXFLAGS -std=c++11"
-CXXFLAGS="$CXXFLAGS -Wall -Wextra -Werror -Wshadow"
-CFLAGS="$CFLAGS -Wall -Wextra -Werror"
+CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wshadow"
+CFLAGS="$CFLAGS -Wall -Wextra"
+
+AC_MSG_CHECKING([whether to turn warnings to errors])
+if test -z "$enable_werror" -o "$enable_werror" = "yes"; then
+    AC_MSG_RESULT([yes])
+    CXXFLAGS="$CXXFLAGS -Werror"
+    CFLAGS="$CFLAGS -Werror"
+else
+    AC_MSG_RESULT([no])
+fi
 
 # check for C++11 support
 HAVE_CXX11=
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to