fix bug of compile asan ut

This commit is contained in:
LianLiguang 2021-02-08 14:47:36 +08:00
parent f7b5a327b8
commit 4ea89fd18e
1 changed files with 5 additions and 2 deletions

View File

@ -41,10 +41,13 @@ endif()
if(ENABLE_ASAN)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -fsanitize=address -fsanitize-recover=address -fno-omit-frame-pointer -fsanitize=undefined")
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -fsanitize=address -fsanitize-recover=address \
-fno-omit-frame-pointer -fsanitize=undefined")
else()
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libsan -fsanitize=undefined")
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer \
-static-libsan -fsanitize=undefined")
endif()
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -mcmodel=medium")
endif()
if(DEBUG_MODE)