diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-26 02:18:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-26 02:18:35 +0300 |
commit | 1d13723e0a42a770aa4d421c9786d1429ab8d125 (patch) | |
tree | 71fe0da6b5af3158517a5004a161dbfc9c5fa3d0 | |
parent | 19314ec1a0b4aaaa3d80e0e31167564d26ebbe46 (diff) | |
download | plus-1d13723e0a42a770aa4d421c9786d1429ab8d125.tar.gz plus-1d13723e0a42a770aa4d421c9786d1429ab8d125.tar.bz2 plus-1d13723e0a42a770aa4d421c9786d1429ab8d125.tar.xz plus-1d13723e0a42a770aa4d421c9786d1429ab8d125.zip |
Add configure flag --enable-werror
Enable it by default in some build scripts.
-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 \ |