Add -DNDEBUG to CFLAGS and CXXFLAGS in CMake build style

CMake adds -DNDEBUG with build types Release, MinSizeRel and RelWithDebInfo.
NDEBUG disables assert(), which can improve performance.
This commit is contained in:
Joshua Krämer 2021-07-15 23:56:25 +02:00 committed by Daniel Kolesa
parent 3c46c0d201
commit 636336b1a7

View file

@ -63,8 +63,8 @@ _EOF
cmake_args+=" -DCMAKE_INSTALL_SBINDIR=bin"
export CMAKE_GENERATOR="${CMAKE_GENERATOR:-Ninja}"
# Override flags: https://gitlab.kitware.com/cmake/cmake/issues/19590
CFLAGS="${CFLAGS/ -pipe / }" CXXFLAGS="${CXXFLAGS/ -pipe / }" \
# Remove -pipe: https://gitlab.kitware.com/cmake/cmake/issues/19590
CFLAGS="-DNDEBUG ${CFLAGS/ -pipe / }" CXXFLAGS="-DNDEBUG ${CXXFLAGS/ -pipe / }" \
cmake ${cmake_args} ${configure_args} ${wrksrc}/${build_wrksrc}
# Replace -isystem with -I