Skip to content
Snippets Groups Projects
Commit 74bcb32c authored by Ankit Meel's avatar Ankit Meel
Browse files

macOS: Remove ASan debug flags from release config.

Setting `PLATFORM_LINKLIBS` is not required for clang, compiler and
linker flags are enough. Note that the change made in
{rBa4c5811e2127}) to `platform_apple.cmake` (appending to
`PLATFORM_CFLAGS`) has not been reverted. platform file shouldn't be
overwriting the flags.

`PLATFORM_LINKFLAGS` is overwritten by `platform_apple.cmake`, so no
point in setting it. Fixing that like `PLATFORM_CFLAGS` is out of the
scope of this change.

`PLATFORM_LINKFLAGS_DEBUG` has been replaced with generator expression
to include RelWithDebInfo and MinSizeRel build types also.
parent e7bb7836
No related branches found
Tags
No related merge requests found
...@@ -859,13 +859,13 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release") ...@@ -859,13 +859,13 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
if(MSVC) if(MSVC)
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6") set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
endif() endif()
if(APPLE)
# COMPILER_ASAN_CFLAGS and COMPILER_ASAN_CXXFLAGS are the same as of if(APPLE AND COMPILER_ASAN_LIBRARY)
# now, so use either for PLATFORM_CFLAGS. string(REPLACE " " ";" _list_COMPILER_ASAN_CFLAGS ${COMPILER_ASAN_CFLAGS})
set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} ${COMPILER_ASAN_CFLAGS}") add_compile_options("$<$<NOT:$<CONFIG:Release>>:${_list_COMPILER_ASAN_CFLAGS}>")
set(COMPILER_ASAN_LINKER_FLAGS "-fno-omit-frame-pointer -fsanitize=address") add_link_options("$<$<NOT:$<CONFIG:Release>>:-fno-omit-frame-pointer;-fsanitize=address>")
endif(APPLE) unset(_list_COMPILER_ASAN_CFLAGS)
if(COMPILER_ASAN_LIBRARY) elseif(COMPILER_ASAN_LIBRARY)
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}") set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}")
set(PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}") set(PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}") set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment