Skip to content

Commit

Permalink
Merge pull request #3522 from wdv4758h/clang-3.7-options
Browse files Browse the repository at this point in the history
build: fix '-fno-sanitize-recover' warning in Clang 3.7
  • Loading branch information
justinmk committed May 16, 2016
2 parents 71450b5 + c9067db commit 33ba27b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/nvim/CMakeLists.txt
@@ -1,4 +1,5 @@
include(CheckLibraryExists)
include(CheckCCompilerFlag)

option(USE_GCOV "Enable gcov support" OFF)

Expand Down Expand Up @@ -258,8 +259,14 @@ install_helper(TARGETS nvim)

if(CLANG_ASAN_UBSAN)
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 "-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 ")
elseif(CLANG_MSAN)
message(STATUS "Enabling Clang memory sanitizer for nvim.")
Expand Down

0 comments on commit 33ba27b

Please sign in to comment.