summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2018-10-24 18:53:11 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2018-10-30 16:41:05 +0000
commit29283921b72fa9386322fc9eb301d00e88b634b6 (patch)
tree3543aef26be0dbc6ce7a131de801cce2ddf06cfb /configure.ac
parenta8bed38b54a22450960e4ff2ca1e30d8cf33c141 (diff)
downloadmesa-29283921b72fa9386322fc9eb301d00e88b634b6.tar.gz
mesa-29283921b72fa9386322fc9eb301d00e88b634b6.tar.bz2
mesa-29283921b72fa9386322fc9eb301d00e88b634b6.zip
m4: add Werror when checking for compiler flags
Seemingly that at some point clang started accepting _any_ flags, whereas previously it would error out. These days, you can give it -Whamsandwich and it will succeed, while at the same time throwing an annoying warning. Add -Werror so that everything gets flagged and set accordingly. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108082 Cc: Vinson Lee <vlee@freedesktop.org> Repored-by: Vinson Lee <vlee@freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 156fb15fd3d..be9674a0c1d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -297,6 +297,12 @@ esac
AM_CONDITIONAL(HAVE_ANDROID, test "x$android" = xyes)
+# Toggle Werror since at some point clang started treating unknown -W
+# flags as warnings, succeeding with the build, yet issuing an annoying
+# warning.
+save_CFLAGS="$CFLAGS"
+export CFLAGS="$CFLAGS -Werror"
+
dnl
dnl Check compiler flags
dnl
@@ -312,6 +318,11 @@ AX_CHECK_COMPILE_FLAG([-fno-math-errno], [CFLAGS="$CFLAGS
AX_CHECK_COMPILE_FLAG([-fno-trapping-math], [CFLAGS="$CFLAGS -fno-trapping-math"])
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [VISIBILITY_CFLAGS="-fvisibility=hidden"])
+CFLAGS="$save_CFLAGS"
+
+# Toggle Werror since at some point clang started treating unknown -W
+# flags as warnings, succeeding with the build, yet issuing an annoying
+# warning.
dnl
dnl Check C++ compiler flags
dnl