can rounghly codegen

This commit is contained in:
2024-10-22 12:09:09 +00:00
parent 4c9d010ff7
commit 17816f2bf0
9 changed files with 597 additions and 27 deletions

View File

@ -25,6 +25,16 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
endif()
endif()
# 设置 Release 模式下开启优化
if(CMAKE_BUILD_TYPE STREQUAL "Release")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-Wall -Wextra -Wpedantic -fsanitize=address,undefined -O2)
add_link_options(-fsanitize=address,undefined)
elseif(MSVC)
add_compile_options(/O2)
endif()
endif()
include(FetchContent)
FetchContent_Declare(
googletest