From 85d8a78dce4ff0346dadf37969b4e58e128249ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Kr=C3=A4mer?= Date: Thu, 15 Jul 2021 23:56:25 +0200 Subject: [PATCH] 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. --- common/build-style/cmake.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh index a7627e7dcf21..401dabad31c8 100644 --- a/common/build-style/cmake.sh +++ b/common/build-style/cmake.sh @@ -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