mirror of
https://github.com/chylex/Nextcloud-Desktop.git
synced 2024-11-25 01:42:47 +01:00
704e34fa99
Signed-off-by: asapelkin <asapelkin0x01@ya.ru>
18 lines
539 B
CMake
18 lines
539 B
CMake
|
|
# Enable address sanitizer (gcc/clang only)
|
|
macro(ENABLE_SANITIZER)
|
|
|
|
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
|
message(FATAL_ERROR "Sanitizer supported only for gcc/clang")
|
|
endif()
|
|
|
|
set(SANITIZER_FLAGS "-fsanitize=address -fsanitize=leak -g")
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}")
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}")
|
|
|
|
set(LINKER_FLAGS "-fsanitize=address,undefined -fuse-ld=gold")
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
|
|
|
endmacro()
|
|
|