[Bf-blender-cvs] [6535135ef73] master: CMake/macOS: consider MinSizeRel too for ASan.

Ankit Meel noreply at git.blender.org
Wed Dec 2 08:55:47 CET 2020


Commit: 6535135ef73c10a324138b9ccf7c35fc9450ba44
Author: Ankit Meel
Date:   Wed Dec 2 13:23:25 2020 +0530
Branches: master
https://developer.blender.org/rB6535135ef73c10a324138b9ccf7c35fc9450ba44

CMake/macOS: consider MinSizeRel too for ASan.

===================================================================

M	CMakeLists.txt

===================================================================

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}")



More information about the Bf-blender-cvs mailing list