chore(build): clean up debug build options

This commit is contained in:
fallenoak 2025-12-26 19:30:35 -06:00
parent e16ccdb1e7
commit 511c40aaa4
3 changed files with 56 additions and 32 deletions

View file

@ -62,10 +62,18 @@ if(HAS_NO_INVALID_OFFSETOF)
)
endif()
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_BUILD_TYPE STREQUAL "Debug")
include(CodeCoverage)
target_compile_options(${PROJECT_NAME} PRIVATE -g -fprofile-arcs -ftest-coverage -O0)
# Standalone builds
if(WHOA_STANDALONE)
# Debug build options
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# GCC debug build options
if(CMAKE_COMPILER_IS_GNUCXX)
# Enable coverage reporting
include(CodeCoverage)
target_compile_options(${PROJECT_NAME} PRIVATE -g -fprofile-arcs -ftest-coverage -O0)
# Enable ASan for debug builds on gcc
target_compile_options(storm PRIVATE -fsanitize=address -fno-omit-frame-pointer)
# Enable ASan
target_compile_options(storm PRIVATE -fsanitize=address -fno-omit-frame-pointer)
endif()
endif()
endif()