Commit b99800a3 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵
Browse files

Don't disable assertions for releases and provide a new GST_ENABLE_EXTRA_CHECKS #define

Assertions are useful to have in any case, and we were abusing the #define for
adding extra checks to our code. Let's do it properly!

https://bugzilla.gnome.org/show_bug.cgi?id=756870
parent ad590e74
......@@ -358,3 +358,29 @@ AC_DEFUN([AG_GST_ARG_DISABLE_FATAL_WARNINGS],
fi
])
])
dnl Enable extra checks by default only for development versions
AC_DEFUN([AG_GST_ARG_ENABLE_EXTRA_CHECKS],
[
AC_ARG_ENABLE(extra-check,
AC_HELP_STRING([--enable-extra-checks],
[Enable extra runtime checks]),
[
case "${enableval}" in
yes) EXTRA_CHECKS=yes ;;
no) EXTRA_CHECKS=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-extra-checks) ;;
esac
],
[
if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then
EXTRA_CHECKS=yes
else
EXTRA_CHECKS=no
fi
])
if test "x$EXTRA_CHECKS" = "xyes"; then
AC_DEFINE(GST_ENABLE_EXTRA_CHECKS, 1, [Define if extra runtime checks should be enabled])
fi
])
......@@ -51,18 +51,9 @@ AC_DEFUN([AG_GST_GLIB_CHECK],
fi
AC_ARG_ENABLE(glib-asserts,
AS_HELP_STRING([--enable-glib-asserts[=@<:@no/auto/yes@:>@]],
AS_HELP_STRING([--enable-glib-asserts[=@<:@no/yes@:>@]],
[Enable GLib assertion]),[enable_glib_assertions=$enableval],
[enable_glib_assertions=auto])
if test "x$enable_glib_assertions" = "xauto"; then
dnl Enable assertions only for development versions
if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "x1"; then
enable_glib_assertions=yes
else
enable_glib_assertions=no
fi
fi
[enable_glib_assertions=yes])
if test "x$enable_glib_assertions" = "xno"; then
GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_ASSERT"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment