From 770d4f6b4cc99bff87d27f4cbe52b2c6a2f2fbd2 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 8 Jan 2020 18:30:06 +0100 Subject: [PATCH] configure: provide a cli flag instead of forcing -Werror --- configure.ac | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 86f986a7..98de0a3e 100644 --- a/configure.ac +++ b/configure.ac @@ -83,7 +83,6 @@ AX_COMPILER_VENDOR AX_COMPILER_VERSION AC_LANG_POP([C++]) - AX_ASSERT AX_PLATFORM @@ -342,6 +341,16 @@ AX_ENDIAN AX_ASSERT AX_HARDEN_COMPILER_FLAGS +AC_ARG_ENABLE([warnings-as-errors], AS_HELP_STRING([--enable-warnings-as-errors], + [Build with -Werror enabled]), , [enable_warnings_as_errors=no]) +AC_CACHE_CHECK([if all warnings should produce an error], [ac_cv_warnings_as_errors], [ + AS_IF([test "x$enable_warnings_as_errors" = "xyes"], [ + ac_cv_warnings_as_errors=yes + ], [ + ac_cv_warnings_as_errors=no + ]) +]) + AX_AM_JOBSERVER([yes]) AC_CONFIG_FILES([Makefile -- 2.30.2