From a4c5811e21271d0f26e0534f25800059c198982d Mon Sep 17 00:00:00 2001 From: Ankit Meel Date: Wed, 16 Sep 2020 02:16:15 +0530 Subject: ASan/macOS: fix incomplete C/CXX compiler flags. While testing for {rB40dcf686f04f}, compiler flags got mixed up and non-working ASan configuration was committed. Platform file, which is `include`d after the `CMAKE_C_FLAGS_DEBUG` etc., are set, overwrites those flags instead of appending to them. To fix this, `PLATFORM_CFLAGS` is used to pass the `-fsanitize=*` flags to the C/C++ compiler. Tested on fresh build using both Xcode and Ninja, with & without ccache. Also silence a clang warning for multi-config generators: the object size sanitizer has no effect at -O0, but is explicitly enabled: -fsanitize=object-size [-Winvalid-command-line-argument] Reviewed By: brecht Differential Revision: https://developer.blender.org/D8879 --- build_files/cmake/platform/platform_apple.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build_files') diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake index 822110cb88f..c16fa4b2e30 100644 --- a/build_files/cmake/platform/platform_apple.cmake +++ b/build_files/cmake/platform/platform_apple.cmake @@ -190,7 +190,7 @@ if(SYSTEMSTUBS_LIBRARY) list(APPEND PLATFORM_LINKLIBS SystemStubs) endif() -set(PLATFORM_CFLAGS "-pipe -funsigned-char") +set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -pipe -funsigned-char") set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework Metal -framework QuartzCore" ) -- cgit v1.2.3