Skip to content

Commit

Permalink
Disable gcc sanitizer on macos by default
Browse files Browse the repository at this point in the history
According to https://github.com/orgs/Homebrew/discussions/3384#discussioncomment-6264292,
gcc now dosen't support libsanitizer on macOS with arm64 and macOS Ventuna or later with x86_64.
  • Loading branch information
FeignClaims committed Mar 27, 2024
1 parent 72832ca commit 6337d19
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/DynamicProjectOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,14 @@ macro(dynamic_project_options)
)
endif()

if((CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*" OR CMAKE_CXX_COMPILER_ID MATCHES ".*GNU.*")
AND NOT WIN32
if(((CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*") AND(NOT WIN32))
OR((CMAKE_CXX_COMPILER_ID MATCHES ".*GNU.*") AND(NOT WIN32) AND(NOT APPLE))
)
set(SUPPORTS_UBSAN ON)
set(SUPPORTS_ASAN ON)
else()
set(SUPPORTS_UBSAN OFF)
endif()

if((CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*" OR CMAKE_CXX_COMPILER_ID MATCHES ".*GNU.*")
AND WIN32
)
set(SUPPORTS_ASAN OFF)
else()
set(SUPPORTS_ASAN ON)
endif()

# ccache, clang-tidy, cppcheck are only supported with Ninja and Makefile based generators
Expand Down

0 comments on commit 6337d19

Please sign in to comment.