diff --git a/474.patch b/474.patch deleted file mode 100644 index 21b43ea28..000000000 --- a/474.patch +++ /dev/null @@ -1,161 +0,0 @@ -From b1c7e6a57d896352dfaf2396a4644b61960b4a24 Mon Sep 17 00:00:00 2001 -From: AUA -Date: Mon, 4 Nov 2024 11:48:42 +0000 -Subject: [PATCH 1/3] commit-message: update the cmakelists.txt #432 - ---- - CMakeLists.txt | 27 ++++++++++++++------------- - build.sh | 31 ++++++++++++++----------------- - 2 files changed, 28 insertions(+), 30 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 31b5917f6..1b6540d9b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -10,6 +10,14 @@ SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) - - SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) - -+# 设置默认构建类型为 Debug -+if(NOT CMAKE_BUILD_TYPE) -+ set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type:Default is debug" FORCE) -+endif() -+ -+# 输出当前构建类型 -+message(STATUS "Using build type: ${CMAKE_BUILD_TYPE}") -+ - OPTION(ENABLE_ASAN "Enable build with address sanitizer" ON) - OPTION(ENABLE_TSAN "Build with thread sanitizer" OFF) - OPTION(ENABLE_UBSAN "Build with undefined behavior sanitizer" OFF) -@@ -57,19 +65,6 @@ IF(USE_SIMD) - ADD_DEFINITIONS(-DUSE_SIMD) - ENDIF(USE_SIMD) - --IF(DEBUG) -- MESSAGE(STATUS "DEBUG has been set as TRUE ${DEBUG}") -- SET(CMAKE_COMMON_FLAGS "${CMAKE_COMMON_FLAGS} -O0 -g -DDEBUG ") -- ADD_DEFINITIONS(-DENABLE_DEBUG) --ELSEIF(NOT DEFINED ENV{DEBUG}) -- MESSAGE(STATUS "Disable debug") -- SET(CMAKE_COMMON_FLAGS "${CMAKE_COMMON_FLAGS} -O2 -g ") --ELSE() -- MESSAGE(STATUS "Enable debug") -- SET(CMAKE_COMMON_FLAGS "${CMAKE_COMMON_FLAGS} -O0 -g -DDEBUG") -- ADD_DEFINITIONS(-DENABLE_DEBUG) --ENDIF(DEBUG) -- - IF (CONCURRENCY) - MESSAGE(STATUS "CONCURRENCY is ON") - SET(CMAKE_COMMON_FLAGS "${CMAKE_COMMON_FLAGS} -DCONCURRENCY") -@@ -164,6 +159,12 @@ ENDIF(WITH_UNIT_TESTS) - - SET(CMAKE_CXX_FLAGS ${CMAKE_COMMON_FLAGS}) - SET(CMAKE_C_FLAGS ${CMAKE_COMMON_FLAGS}) -+ -+set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -O0 -DDEBUG") -+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -DNDEBUG") -+set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O2 -g -DDEBUG") -+set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -Os") -+ - MESSAGE(STATUS "CMAKE_CXX_FLAGS is " ${CMAKE_CXX_FLAGS}) - - # ADD_SUBDIRECTORY(src bin) bin 为目标目录, 可以省略 -diff --git a/build.sh b/build.sh -index 0a914d671..4b4f0f2f7 100755 ---- a/build.sh -+++ b/build.sh -@@ -137,8 +137,8 @@ function do_build - { - TYPE=$1; shift - prepare_build_dir $TYPE || return -- echo "${CMAKE_COMMAND} ${TOPDIR} $@" -- ${CMAKE_COMMAND} -S ${TOPDIR} $@ -+ echo "${CMAKE_COMMAND} $@ ${TOPDIR}" -+ ${CMAKE_COMMAND} $@ -S ${TOPDIR} - } - - function do_clean -@@ -147,23 +147,20 @@ function do_clean - find . -maxdepth 1 -type d -name 'build_*' | xargs rm -rf - } - --function build --{ -- set -- "${BUILD_ARGS[@]}" -- case "x$1" in -- xrelease) -- do_build "$@" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEBUG=OFF -- ;; -- xdebug) -- do_build "$@" -DCMAKE_BUILD_TYPE=Debug -DDEBUG=ON -- ;; -- *) -- BUILD_ARGS=(debug "${BUILD_ARGS[@]}") -- build -- ;; -- esac -+function build { -+ # 默认参数是 debug -+ if [ -z "${BUILD_ARGS[0]}" ]; then -+ set -- "debug" # 如果没有参数,则设置默认值 -+ else -+ set -- "${BUILD_ARGS[@]}" # 否则使用 BUILD_ARGS 的第一个参数 -+ fi -+ local build_type_lower=$(echo "$1" | tr '[:upper:]' '[:lower:]') # 转换为小写 -+ echo "Build type: $build_type_lower" # 输出构建类型 -+ -+ do_build "$build_type_lower" -DCMAKE_BUILD_TYPE="$build_type_lower" # 调用 do_build - } - -+ - function main - { - case "$1" in - -From 360240155dd67d397cd406c6e23c543e53bace48 Mon Sep 17 00:00:00 2001 -From: AUA -Date: Mon, 4 Nov 2024 12:27:03 +0000 -Subject: [PATCH 2/3] commit-message: update the cmakelists.txt #432 - ---- - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1b6540d9b..a6618dc4e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -161,7 +161,7 @@ SET(CMAKE_CXX_FLAGS ${CMAKE_COMMON_FLAGS}) - SET(CMAKE_C_FLAGS ${CMAKE_COMMON_FLAGS}) - - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -O0 -DDEBUG") --set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -DNDEBUG") -+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O2 -g -DDEBUG") - set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -Os") - - -From 8c68a18b6035177e0f30e54569b45f50f0e7e193 Mon Sep 17 00:00:00 2001 -From: AUA -Date: Mon, 4 Nov 2024 12:48:05 +0000 -Subject: [PATCH 3/3] commit-message: update the cmakelists.txt #432 - ---- - build.sh | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/build.sh b/build.sh -index 4b4f0f2f7..e0ba80810 100755 ---- a/build.sh -+++ b/build.sh -@@ -137,8 +137,8 @@ function do_build - { - TYPE=$1; shift - prepare_build_dir $TYPE || return -- echo "${CMAKE_COMMAND} $@ ${TOPDIR}" -- ${CMAKE_COMMAND} $@ -S ${TOPDIR} -+ echo "${CMAKE_COMMAND} ${TOPDIR} $@" -+ ${CMAKE_COMMAND} -S ${TOPDIR} $@ - } - - function do_clean