From 3fcfe6db5678ecde9ca20ca058c1a603cc8abfc2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 30 Apr 2016 01:14:44 +0300 Subject: Add configure option --enable-asserts --- configure.ac | 13 +++++++++++++ src/Makefile.am | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/configure.ac b/configure.ac index 8f009883e..d14df03be 100755 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,19 @@ esac],[werror_enabled=false]) AM_CONDITIONAL(ENABLE_WERROR, test x$werror_enabled = xtrue) +# Enable asserts +AC_ARG_ENABLE(asserts, +[ --enable-asserts Enable asserts in log], +[case "${enableval}" in + yes) asserts_enabled=true + ;; + no) asserts_enabled=false + ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-asserts) ;; +esac],[asserts_enabled=true]) + +AM_CONDITIONAL(ENABLE_ASSERTS, test x$asserts_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 2fcea1281..68c8294d1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,6 +18,11 @@ manaplus_CXXFLAGS += -Werror dyecmd_CXXFLAGS += -Werror endif +if ENABLE_ASSERTS +manaplus_CXXFLAGS += -DENABLE_ASSERTS +dyecmd_CXXFLAGS += -DENABLE_ASSERTS +endif + if ENABLE_PUGIXML manaplus_CXXFLAGS += -DENABLE_PUGIXML dyecmd_CXXFLAGS += -DENABLE_PUGIXML @@ -1766,6 +1771,9 @@ endif if ENABLE_WERROR manaplustests_CXXFLAGS += -Werror endif +if ENABLE_ASSERTS +manaplustests_CXXFLAGS += -DENABLE_ASSERTS +endif manaplustests_SOURCES = ${manaplus_SOURCES} \ enums/enums_unittest.cc \ -- cgit v1.2.3-70-g09d2