aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-09-21 08:09:09 -0400
committerJames McCoy <jamessan@jamessan.com>2017-09-23 07:42:15 -0400
commit6d471636ee3bcdea7ac0c083b73f050eb720b394 (patch)
treea04bfea38bf9e20f320d96b3e855e410f2eae16c
parentf8dcd319d9338cccc66ae481d5865e8816794306 (diff)
downloadrneovim-6d471636ee3bcdea7ac0c083b73f050eb720b394.tar.gz
rneovim-6d471636ee3bcdea7ac0c083b73f050eb720b394.tar.bz2
rneovim-6d471636ee3bcdea7ac0c083b73f050eb720b394.zip
cmake: Check if the compiler understands -Wno-array-bounds
Closes #7297
-rw-r--r--CMakeLists.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4e82868337..df29774d45 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -254,7 +254,10 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.5")
# Array-bounds testing is broken in some GCC versions before 4.8.5.
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
- add_definitions(-Wno-array-bounds)
+ check_c_compiler_flag(-Wno-array-bounds HAS_NO_ARRAY_BOUNDS_FLAG)
+ if(HAS_NO_ARRAY_BOUNDS_FLAG)
+ add_definitions(-Wno-array-bounds)
+ endif()
endif()
endif()