Skip to content

Commit

Permalink
Update clang/Sanitize options
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperpedersen committed Jan 17, 2025
1 parent 1502d97 commit b2ce09e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,15 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
if (NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
add_compile_options(-fsanitize=address)

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS_DEBUG} -fsanitize=address")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -fsanitize=address")
add_compile_options(-fsanitize=undefined)
add_compile_options(-fno-sanitize-recover=all)
add_compile_options(-fsanitize=float-divide-by-zero)
add_compile_options(-fsanitize=float-cast-overflow)
add_compile_options(-fno-sanitize=null)
add_compile_options(-fno-sanitize=alignment)

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS_DEBUG} -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment")
endif()
endif()
endif()
Expand Down

0 comments on commit b2ce09e

Please sign in to comment.