summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuyu <[email protected]>2024-07-07 21:45:50 +0800
committerliuyu <[email protected]>2024-07-07 21:45:50 +0800
commitf97ce2fd155117ebb63d413fb9bd76d5bdf96699 (patch)
tree6811394b83c2ca246baad5bdaf5e079d7e75fc17
parent998f33b111c930fe64cd37efbd0e0ae60ccb52c6 (diff)
修改cmake
-rw-r--r--bbq/CMakeLists.txt6
-rw-r--r--perf/CMakeLists.txt4
2 files changed, 5 insertions, 5 deletions
diff --git a/bbq/CMakeLists.txt b/bbq/CMakeLists.txt
index bd81b28..f6cf563 100644
--- a/bbq/CMakeLists.txt
+++ b/bbq/CMakeLists.txt
@@ -13,12 +13,12 @@ if(NOT DEFINED OUTPUT_DIR)
endif()
# 设置编译类型,默认Release
+add_compile_options(-Wall -Wextra -flto)
+
if(NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
+ set(CMAKE_BUILD_TYPE Release)
endif()
-add_compile_options(-Wall -Wextra)
-
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DBBQ_MEMORY)
endif()
diff --git a/perf/CMakeLists.txt b/perf/CMakeLists.txt
index 2b0d1a0..bcb5aba 100644
--- a/perf/CMakeLists.txt
+++ b/perf/CMakeLists.txt
@@ -22,11 +22,11 @@ endif()
# 设置编译类型,默认Release
if(NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
+ set(CMAKE_BUILD_TYPE Release)
endif()
add_definitions(-D_GNU_SOURCE)
-add_compile_options(-Wall -Wextra)
+add_compile_options(-Wall -Wextra -flto)
# 库生成的路径
set(LIB_PATH ${OUTPUT_DIR}/lib)