diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-05-16 00:20:20 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-05-16 00:20:20 -0400 |
commit | 33ba27b0026aef9f854de0d63b6c486d99c2d795 (patch) | |
tree | 120199e173d6efee638ecfa0a93c0e49d09301fe /src | |
parent | 71450b54aa22fd1d60e5b4d0929f254a56c8869d (diff) | |
parent | c9067dbe8a9a11e28568b81de8dda00b08b37cba (diff) | |
download | rneovim-33ba27b0026aef9f854de0d63b6c486d99c2d795.tar.gz rneovim-33ba27b0026aef9f854de0d63b6c486d99c2d795.tar.bz2 rneovim-33ba27b0026aef9f854de0d63b6c486d99c2d795.zip |
Merge pull request #3522 from wdv4758h/clang-3.7-options
build: fix '-fno-sanitize-recover' warning in Clang 3.7
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/CMakeLists.txt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 0711642868..6b2ce08d36 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -1,4 +1,5 @@ include(CheckLibraryExists) +include(CheckCCompilerFlag) option(USE_GCOV "Enable gcov support" OFF) @@ -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.") |