Skip to content

Commit 0aa711a

Browse files
author
gberkes
committed
Explicitly use -UNDEBUG when --enable-assertions=yes is specified.
1 parent e55cd9f commit 0aa711a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

configure.ac

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ AC_ARG_ENABLE(assertions,
234234
[case "${enableval}" in
235235
yes) assertions=true ;;
236236
no) assertions=false ;;
237-
*) AC_MSG_ERROR(bad value ${enableval} for --enable-asserions) ;;
237+
*) AC_MSG_ERROR(bad value ${enableval} for --enable-assertions) ;;
238238
esac],
239239

240240
[assertions=false]
@@ -369,10 +369,12 @@ if test "$aflFuzzer" == "true"; then
369369
$buildExamples = false
370370
fi
371371

372-
if test "$assertions" == "false"; then
373-
ASSERTIONS_CPPCFLAGS="-DNDEBUG"
374-
GLOBAL_CPPFLAGS="$GLOBAL_CPPFLAGS $ASSERTIONS_CPPCFLAGS"
375-
fi
372+
case $assertions in
373+
false) ASSERTIONS_CPPCFLAGS="-DNDEBUG" ;;
374+
true) ASSERTIONS_CPPCFLAGS="-UNDEBUG" ;;
375+
*) AC_MSG_ERROR(bad value ${assertions} for assertions) ;;
376+
esac
377+
GLOBAL_CPPFLAGS="$GLOBAL_CPPFLAGS $ASSERTIONS_CPPCFLAGS"
376378

377379
AC_SUBST(GLOBAL_LDADD)
378380
AC_SUBST(GLOBAL_CPPFLAGS)

0 commit comments

Comments
 (0)