Skip to content

Commit

Permalink
add -shared-libasan option on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
opcm authored Oct 5, 2024
1 parent cea1c43 commit de9dc0e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ if(UNIX) # APPLE, LINUX, FREE_BSD
message(STATUS "AddressSanitizer is enabled")
message(STATUS "To disable AddressSanitizer, use -DPCM_NO_ASAN=1 option")
set(PCM_ASAN "-fsanitize=address")
if(APPLE)
set(PCM_ASAN "${PCM_ASAN} -shared-libasan")
endif()
endif()
set(PCM_HARDENING_FLAGS "-fPIE -fstack-protector -D_FORTIFY_SOURCE=2 -ftrapv ${PCM_ASAN} -fwrapv -fno-delete-null-pointer-checks -fno-strict-overflow -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
Expand Down

0 comments on commit de9dc0e

Please sign in to comment.