From 1af5a29d87a011232ae665d1c5f910f9b73588fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sun, 14 Mar 2021 20:18:03 +0700 Subject: [PATCH] build-style/cmake: set CMAKE_BUILD_TYPE to None - CMAKE_BUILD_TYPE=Release will force -O3 instead of respecting our CFLAGS and CXXFLAGS - Theoretically, we could patch cmake to always use -O2 instead, however, patching will break users' expectation when compiling their our code. - RelWithDebInfo could be another option if it's acceptable to always have debug symbol available. - However, some projects ignore all CFLAGS and CXXFLAGS; - Some other projects relies on CMAKE_BUILD_TYPE=Release to install to correct location and/or disable coverage. - To get away with -O3, we need patching either ways, let's go with CMAKE_BUILD_TYPE=None, and patch all problematic softwares. --- common/build-style/cmake.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh index 5100a96dfd7..9d1a1a7a194 100644 --- a/common/build-style/cmake.sh +++ b/common/build-style/cmake.sh @@ -52,7 +52,7 @@ _EOF cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake" fi cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr" - cmake_args+=" -DCMAKE_BUILD_TYPE=Release" + cmake_args+=" -DCMAKE_BUILD_TYPE=None" cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}" if [[ $build_helper = *"qemu"* ]]; then