mirror of
https://github.com/Raymo111/i3lock-color.git
synced 2024-12-02 14:05:43 -05:00
build: disable debug and sanitizers by default (#251)
Debug builds should never be the default. Change debug option to default to off and link it to sanitizer usage (rather than whether being built from git tree). Address sanitizers can cause a program to run twice as slow on top of the debug "-O0" non-optimisation. Also remove some unused macro variables.
This commit is contained in:
parent
37eecf221e
commit
ac6b471a49
2 changed files with 8 additions and 8 deletions
4
build.sh
4
build.sh
|
@ -1,12 +1,12 @@
|
||||||
#!/bin/sh -x
|
#!/bin/sh -x
|
||||||
|
|
||||||
configureOpts="--disable-sanitizers --disable-debug"
|
configureOpts=""
|
||||||
|
|
||||||
while getopts ":hd" opt; do
|
while getopts ":hd" opt; do
|
||||||
case ${opt} in
|
case ${opt} in
|
||||||
h ) echo "Use -d to turn on sanitizers (for debugging only)"
|
h ) echo "Use -d to turn on sanitizers (for debugging only)"
|
||||||
exit;;
|
exit;;
|
||||||
d ) configureOpts=""
|
d ) configureOpts="--enable-debug"
|
||||||
;;
|
;;
|
||||||
\? ) echo "Usage: $0 [-h] [-d]"
|
\? ) echo "Usage: $0 [-h] [-d]"
|
||||||
exit;;
|
exit;;
|
||||||
|
|
12
configure.ac
12
configure.ac
|
@ -48,7 +48,7 @@ AX_CODE_COVERAGE
|
||||||
|
|
||||||
dnl is_release must be lowercase because AX_CHECK_ENABLE_DEBUG calls m4_tolower
|
dnl is_release must be lowercase because AX_CHECK_ENABLE_DEBUG calls m4_tolower
|
||||||
dnl on its fourth argument.
|
dnl on its fourth argument.
|
||||||
AX_CHECK_ENABLE_DEBUG([yes], , [UNUSED_NDEBUG], [$is_release])
|
AX_CHECK_ENABLE_DEBUG([no], , , [$is_release])
|
||||||
|
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
|
|
||||||
|
@ -132,14 +132,14 @@ AC_CHECK_HEADERS([fcntl.h float.h inttypes.h limits.h locale.h netinet/in.h path
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile])
|
AC_CONFIG_FILES([Makefile])
|
||||||
|
|
||||||
# Enable address sanitizer for non-release builds. The performance hit is a
|
# Enable address sanitizer for debug builds. The performance hit is a
|
||||||
# 50% increase of wallclock time for the testsuite on my machine.
|
# 50% increase of wallclock time for the testsuite on my machine.
|
||||||
if test x$is_release = xyes; then
|
if test "x$ax_enable_debug" = "xyes"; then
|
||||||
default_sanitizers=
|
|
||||||
else
|
|
||||||
default_sanitizers=address
|
default_sanitizers=address
|
||||||
|
else
|
||||||
|
default_sanitizers=
|
||||||
fi
|
fi
|
||||||
AX_SANITIZERS(, [$default_sanitizers], [AC_DEFINE([I3LOCK_ASAN_ENABLED], [], [Enable ASAN])])
|
AX_SANITIZERS(, [$default_sanitizers])
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue