Skip to content
Snippets Groups Projects
Commit 3f90a3b2 authored by Adrien Béraud's avatar Adrien Béraud Committed by Andreas Traczyk
Browse files

build: set default flags before AC_PROG_CXX


Change-Id: Idaa6532471d24ebd01613d01843fc3e0758d0025
Reviewed-by: default avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 30ce9ccc
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,16 @@ AC_CONFIG_HEADERS([config.h])
# Silent build by default. Use make V=1 to increase verbosity
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
dnl debug mode is default-disabled
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Build in debug mode, adds stricter warnings, disables optimization]))
AS_IF([test "x$enable_debug" = "xyes"], [
CFLAGS="${CFLAGS} -g -fno-omit-frame-pointer -Wall -Wextra -Wnon-virtual-dtor -Wno-unknown-pragmas -Wformat=2 -O0"
CXXFLAGS="${CXXFLAGS} -g -fno-omit-frame-pointer -Wall -Wextra -Wnon-virtual-dtor -Wno-unknown-pragmas -Wformat=2 -O0"
], [
CFLAGS="${CFLAGS} -DNDEBUG=1 -O3"
CXXFLAGS="${CXXFLAGS} -DNDEBUG=1 -O3"
])
dnl Check for programs
AC_PROG_CC
AC_PROG_CXX
......@@ -633,18 +643,6 @@ AC_DEFUN([BB_ENABLE_DOXYGEN],
# Actually perform the doxygen check
BB_ENABLE_DOXYGEN
dnl debug mode is default-disabled
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Build in debug mode, adds stricter warnings, disables optimization]))
AS_IF([test "x$enable_debug" = "xyes"],
[CXXFLAGS="${CXXFLAGS} -g -fno-omit-frame-pointer -Wall -Wextra -Wnon-virtual-dtor -Wno-unknown-pragmas -Wformat=2 -O0"],
[CXXFLAGS="${CXXFLAGS} -DNDEBUG=1 -O3"])
dnl What Makefiles to generate
#TODO: split this list across where the relevant check is performed
AC_CONFIG_FILES([Makefile \
bin/Makefile \
src/Makefile \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment