mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-04 08:59:07 +00:00
chore(build): enable ASan for gcc debug builds
This commit is contained in:
parent
2c7c444aad
commit
aadb85d627
2 changed files with 10 additions and 0 deletions
|
|
@ -79,6 +79,10 @@ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
LCOV_ARGS --rc branch_coverage=1
|
LCOV_ARGS --rc branch_coverage=1
|
||||||
GENHTML_ARGS --rc genhtml_branch_coverage=1
|
GENHTML_ARGS --rc genhtml_branch_coverage=1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Enable ASan for debug builds on gcc
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WHOA_TEST_STORMDLL)
|
if(WHOA_TEST_STORMDLL)
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,13 @@ target_include_directories(StormTest
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
include(CodeCoverage)
|
include(CodeCoverage)
|
||||||
|
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE -g -fprofile-arcs -ftest-coverage -O0)
|
target_compile_options(${PROJECT_NAME} PRIVATE -g -fprofile-arcs -ftest-coverage -O0)
|
||||||
|
|
||||||
|
# Enable ASan for debug builds on gcc
|
||||||
|
target_link_options(StormTest
|
||||||
|
PUBLIC -fsanitize=address
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS StormTest DESTINATION "bin")
|
install(TARGETS StormTest DESTINATION "bin")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue