Skip to content

Commit

Permalink
Do not build with debug flag active by default
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane committed Oct 20, 2024
1 parent 7bc45fb commit 0b40062
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,20 @@ AC_CONFIG_FILES([
libmodbus.pc
])

AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[Enable debug symbols (default is no)])],
[enable_debug=$enableval],
[enable_debug=no])

AS_IF([test "x$enable_debug" = "xyes"], [
CFLAGS="-g -O0"
CXXFLAGS="-g -O0"
], [
CFLAGS="-O2"
CXXFLAGS="-O2"
])

AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE $VERSION
Expand Down

0 comments on commit 0b40062

Please sign in to comment.