mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-12 15:24:18 +00:00
c394e33a7a
When building with ASan, core is also built with ASan enabled (and thus using a local build is required). The other two sanitizers aren't also forwarded on to core's settings since they don't need to be.
21 lines
657 B
CMake
21 lines
657 B
CMake
option(SANITIZE_ADDRESS "build with ASan")
|
|
option(SANITIZE_THREAD "build with TSan")
|
|
option(SANITIZE_UNDEFINED "build with UBSan")
|
|
|
|
if(SANITIZE_ADDRESS)
|
|
set(SANITIZER_FLAGS "${SANITIZER_FLAGS} -fsanitize=address")
|
|
endif()
|
|
|
|
if(SANITIZE_THREAD)
|
|
set(SANITIZER_FLAGS "${SANITIZER_FLAGS} -fsanitize=thread")
|
|
endif()
|
|
|
|
if(SANITIZE_UNDEFINED)
|
|
set(SANITIZER_FLAGS "${SANITIZER_FLAGS} -fsanitize=undefined")
|
|
endif()
|
|
|
|
if(SANITIZE_ADDRESS OR SANITIZE_THREAD OR SANITIZE_UNDEFINED)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS} -fno-omit-frame-pointer")
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SANITIZER_FLAGS}")
|
|
endif()
|