From 6535135ef73c10a324138b9ccf7c35fc9450ba44 Mon Sep 17 00:00:00 2001 From: Ankit Meel Date: Wed, 2 Dec 2020 13:23:25 +0530 Subject: CMake/macOS: consider MinSizeRel too for ASan. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7bc1406dc59..842bbff4ba6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -883,9 +883,11 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release") if(APPLE AND COMPILER_ASAN_LIBRARY) string(REPLACE " " ";" _list_COMPILER_ASAN_CFLAGS ${COMPILER_ASAN_CFLAGS}) - add_compile_options("$<$>:${_list_COMPILER_ASAN_CFLAGS}>") - add_link_options("$<$>:-fno-omit-frame-pointer;-fsanitize=address>") + set(_is_CONFIG_DEBUG "$, $>") + add_compile_options("$<${_is_CONFIG_DEBUG}:${_list_COMPILER_ASAN_CFLAGS}>") + add_link_options("$<${_is_CONFIG_DEBUG}:-fno-omit-frame-pointer;-fsanitize=address>") unset(_list_COMPILER_ASAN_CFLAGS) + unset(_is_CONFIG_DEBUG) elseif(COMPILER_ASAN_LIBRARY) set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}") set(PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}") -- cgit v1.2.3