summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarius vlad <marius.c.vlad@intel.com>2016-05-10 17:32:15 +0300
committerMarius Vlad <marius.c.vlad@intel.com>2016-05-11 18:22:05 +0300
commit701d8fdb363443453c4b613e9180f75ad36a7321 (patch)
tree200be95af16c037a99807fadcd764f736db482c1
parent2d432fc5773df17f04283f4780dab161dd2e1c85 (diff)
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 <marius.c.vlad@intel.com> Acked-by: Damien Lespiau <damien.lespiau@intel.com>
-rw-r--r--benchmarks/Makefile.am3
-rw-r--r--configure.ac10
-rw-r--r--demos/Makefile.am3
-rw-r--r--overlay/Makefile.am3
-rw-r--r--tests/Makefile.am2
-rw-r--r--tools/Makefile.am4
6 files changed, 20 insertions, 5 deletions
diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am
index 2c2d1006..49d2f649 100644
--- a/benchmarks/Makefile.am
+++ b/benchmarks/Makefile.am
@@ -2,7 +2,8 @@
include Makefile.sources
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \
+ $(WERROR_CFLAGS)
LDADD = $(top_builddir)/lib/libintel_tools.la
benchmarks_LTLIBRARIES = gem_exec_tracer.la
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 :
diff --git a/demos/Makefile.am b/demos/Makefile.am
index e6fbb3ba..f5725f4f 100644
--- a/demos/Makefile.am
+++ b/demos/Makefile.am
@@ -3,5 +3,6 @@ bin_PROGRAMS = \
$(NULL)
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \
+ $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS)
LDADD = $(top_builddir)/lib/libintel_tools.la
diff --git a/overlay/Makefile.am b/overlay/Makefile.am
index c648875d..c9265578 100644
--- a/overlay/Makefile.am
+++ b/overlay/Makefile.am
@@ -3,7 +3,8 @@ bin_PROGRAMS = intel-gpu-overlay
endif
AM_CPPFLAGS = -I.
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS)
+AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \
+ $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS) $(WERROR_CLFAGS)
LDADD = $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(OVERLAY_LIBS)
intel_gpu_overlay_SOURCES = \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 45e33598..32b91155 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -59,7 +59,7 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS)\
-include "$(srcdir)/../lib/check-ndebug.h" \
-DIGT_SRCDIR=\""$(abs_srcdir)"\" \
-DIGT_DATADIR=\""$(pkgdatadir)"\" \
- $(LIBUNWIND_CFLAGS) \
+ $(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS) \
$(NULL)
LDADD = ../lib/libintel_tools.la $(GLIB_LIBS)
diff --git a/tools/Makefile.am b/tools/Makefile.am
index df48d94a..5f451443 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -3,7 +3,9 @@ include Makefile.sources
SUBDIRS = null_state_gen registers
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\"
+AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \
+ $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\" \
+ $(WERROR_CFLAGS)
LDADD = $(top_builddir)/lib/libintel_tools.la
AM_LDFLAGS = -Wl,--as-needed