Skip to content

Commit

Permalink
tests: Add sanitizers and _FORTIFY_SOURCE to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DNedic committed Nov 3, 2023
1 parent b2a8c13 commit 10568ca
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ add_executable(tests
# Required in order to test the std::span API as well
target_compile_features(tests PRIVATE cxx_std_20)

target_compile_options(tests
PRIVATE
-fno-omit-frame-pointer # For nicer stack traces with sanitizers
-fsanitize=address
-fsanitize=signed-integer-overflow
-fsanitize=bounds
)

target_link_options(tests
PRIVATE
-fsanitize=address
-fsanitize=signed-integer-overflow
-fsanitize=bounds
)

target_link_libraries(tests
PRIVATE
${PROJECT_NAME}
Expand Down

0 comments on commit 10568ca

Please sign in to comment.