build: fix '-fno-sanitize-recover' warning in Clang 3.7

This commit is contained in:
Chiu-Hsiang Hsu
2015-10-26 14:08:16 +08:00
parent 68e5968568
commit c9067dbe8a

View File

@@ -1,4 +1,5 @@
include(CheckLibraryExists) include(CheckLibraryExists)
include(CheckCCompilerFlag)
option(USE_GCOV "Enable gcov support" OFF) option(USE_GCOV "Enable gcov support" OFF)
@@ -252,8 +253,14 @@ install_helper(TARGETS nvim)
if(CLANG_ASAN_UBSAN) if(CLANG_ASAN_UBSAN)
message(STATUS "Enabling Clang address sanitizer and undefined behavior sanitizer for nvim.") message(STATUS "Enabling Clang address sanitizer and undefined behavior sanitizer for nvim.")
check_c_compiler_flag(-fno-sanitize-recover=all SANITIZE_RECOVER_ALL)
if(SANITIZE_RECOVER_ALL)
set(SANITIZE_RECOVER -fno-sanitize-recover=all) # Clang 3.6+
else()
set(SANITIZE_RECOVER -fno-sanitize-recover) # Clang 3.5-
endif()
set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-DEXITFREE ") set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-DEXITFREE ")
set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-fno-sanitize-recover -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address -fsanitize=undefined -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/.asan-blacklist") set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "${SANITIZE_RECOVER} -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address -fsanitize=undefined -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/.asan-blacklist")
set_property(TARGET nvim APPEND_STRING PROPERTY LINK_FLAGS "-fsanitize=address -fsanitize=undefined ") set_property(TARGET nvim APPEND_STRING PROPERTY LINK_FLAGS "-fsanitize=address -fsanitize=undefined ")
elseif(CLANG_MSAN) elseif(CLANG_MSAN)
message(STATUS "Enabling Clang memory sanitizer for nvim.") message(STATUS "Enabling Clang memory sanitizer for nvim.")