!12273 fix asan compile

From: @lianliguang
Reviewed-by: @zhoufeng54,@kisnwang,@chujinjin
Signed-off-by: @zhoufeng54
This commit is contained in:
mindspore-ci-bot 2021-02-18 15:30:36 +08:00 committed by Gitee
commit 9295556bbd
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)