BlueBrain / hpc-coding-conventions

Apache License 2.0
8 stars 5 forks source link

Update sanitizers.cmake for Apple clang #133

Closed ohm314 closed 2 years ago

ohm314 commented 2 years ago

Apple's LLVM fork deals with UBSan flags slightly different than the upstream implementation. First of all, when the UBSan is enabled, all available checks are enabled by default, secondly not all checks from LLVM are available.

https://developer.apple.com/documentation/xcode/diagnosing-memory-thread-and-crash-issues-early

This patch sets UBSan compiler flags accordingly when detecting AppleClang.