Skip to content

Commit 66feae7

Browse files
authored
chore: enable AddressSanitizer for AppleClang builds (#191)
Enables `AddressSanitizer` on macOS builds. Additionally, enables the leak detector in CI for Mac.
1 parent 956fc92 commit 66feae7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ if (BUILD_TESTING)
3131
if (TESTING_SANITIZERS)
3232
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
3333
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=undefined -fsanitize=leak")
34+
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
35+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
3436
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
3537
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=leak")
3638
endif ()

0 commit comments

Comments
 (0)