diff options
-rwxr-xr-x | build/bmake | 3 | ||||
-rwxr-xr-x | build/bmakedebug | 3 | ||||
-rwxr-xr-x | configure.ac | 13 | ||||
-rw-r--r-- | src/Makefile.am | 8 |
4 files changed, 25 insertions, 2 deletions
diff --git a/build/bmake b/build/bmake index 0233974e6..241b582c8 100755 --- a/build/bmake +++ b/build/bmake @@ -48,7 +48,8 @@ autoreconf -i --mandir=$dir/run/share/man \ --enable-memdebug=no \ --enable-tcmalloc=no \ ---enable-googleprofiler=no +--enable-googleprofiler=no \ +--enable-werror cd po make -j8 update-gmo 2>../build/make1.log diff --git a/build/bmakedebug b/build/bmakedebug index ee6a0d210..991d1c259 100755 --- a/build/bmakedebug +++ b/build/bmakedebug @@ -62,7 +62,8 @@ autoreconf -i --enable-memdebug=no \ --enable-tcmalloc=no \ --enable-googleprofiler=no \ ---enable-checks=yes +--enable-checks=yes \ +--enable-werror cd po make -j8 update-gmo 2>../build/make1.log diff --git a/configure.ac b/configure.ac index fa4964ed5..8f009883e 100755 --- a/configure.ac +++ b/configure.ac @@ -4,6 +4,19 @@ AM_INIT_AUTOMAKE([1.9]) AC_CONFIG_HEADERS([config.h:config.h.in]) AC_LANG_CPLUSPLUS +# Enable -Werror +AC_ARG_ENABLE(werror, +[ --enable-werror Fail build if warning present], +[case "${enableval}" in + yes) werror_enabled=true + ;; + no) werror_enabled=false + ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;; +esac],[werror_enabled=false]) + +AM_CONDITIONAL(ENABLE_WERROR, test x$werror_enabled = xtrue) + # Checks for android. AC_ARG_ENABLE(androidbuild, [ --enable-androidbuild Turn on android building], diff --git a/src/Makefile.am b/src/Makefile.am index a28ed7985..d537e8f60 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -13,6 +13,11 @@ manaplus_CXXFLAGS = -DPKG_DATADIR=\""$(pkgdatadir)/"\" \ -DLOCALEDIR=\""$(localedir)"\" \ -Wall +if ENABLE_WERROR +manaplus_CXXFLAGS += -Werror +dyecmd_CXXFLAGS += -Werror +endif + if ENABLE_PUGIXML manaplus_CXXFLAGS += -DENABLE_PUGIXML dyecmd_CXXFLAGS += -DENABLE_PUGIXML @@ -1753,6 +1758,9 @@ manaplustests_CXXFLAGS = ${manaplus_CXXFLAGS} \ if USE_SDL2 manaplustests_CXXFLAGS += -DUSE_SDL2 endif +if ENABLE_WERROR +manaplustests_CXXFLAGS += -Werror +endif manaplustests_SOURCES = ${manaplus_SOURCES} \ enums/enums_unittest.cc \ |