mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-04 00:49:08 +00:00
chore(build): use target-specific directives when enabling ASan
This commit is contained in:
parent
5157c414f5
commit
a5c589f5a9
3 changed files with 5 additions and 7 deletions
|
|
@ -79,10 +79,6 @@ 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)
|
||||||
|
|
|
||||||
|
|
@ -65,4 +65,7 @@ endif()
|
||||||
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_compile_options(storm PRIVATE -fsanitize=address -fno-omit-frame-pointer)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,8 @@ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
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
|
# Enable ASan for debug builds on gcc
|
||||||
target_link_options(StormTest
|
target_compile_options(StormTest PRIVATE -fsanitize=address -fno-omit-frame-pointer)
|
||||||
PUBLIC -fsanitize=address
|
target_link_options(StormTest PRIVATE -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