diff options
author | Ankit Meel <ankitjmeel@gmail.com> | 2020-12-02 10:53:25 +0300 |
---|---|---|
committer | Ankit Meel <ankitjmeel@gmail.com> | 2020-12-02 10:53:25 +0300 |
commit | 6535135ef73c10a324138b9ccf7c35fc9450ba44 (patch) | |
tree | 64935dac9bd4aa2f8f6690185a23c421c0a92e18 | |
parent | a715839a55f1a197de0239b24642b9d999ceff9e (diff) |
CMake/macOS: consider MinSizeRel too for ASan.
-rw-r--r-- | CMakeLists.txt | 6 |
1 files 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("$<$<NOT:$<CONFIG:Release>>:${_list_COMPILER_ASAN_CFLAGS}>") - add_link_options("$<$<NOT:$<CONFIG:Release>>:-fno-omit-frame-pointer;-fsanitize=address>") + set(_is_CONFIG_DEBUG "$<OR:$<CONFIG:Debug>, $<CONFIG:RelWithDebInfo>>") + 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}") |