aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-05-02 23:58:04 -0400
committerJames McCoy <jamessan@jamessan.com>2017-05-12 14:41:51 -0400
commitb43a3dbff8c615fec152e3fb2157961f3d90b705 (patch)
tree5869106a02a266005675bbaa3ac99ad0d2bb9620
parent0ff959329bb8a8ae22856a65b5289b41bdae433a (diff)
downloadrneovim-b43a3dbff8c615fec152e3fb2157961f3d90b705.tar.gz
rneovim-b43a3dbff8c615fec152e3fb2157961f3d90b705.tar.bz2
rneovim-b43a3dbff8c615fec152e3fb2157961f3d90b705.zip
Detect support for and use -Wimplicit-fallthrough
-rw-r--r--CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4d1c0e8fd5..eb259bc983 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -221,6 +221,11 @@ else()
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
-Wstrict-prototypes -std=gnu99)
+ check_c_compiler_flag(-Wimplicit-fallthrough HAS_WIMPLICIT_FALLTHROUGH_FLAG)
+ if(HAS_WIMPLICIT_FALLTHROUGH_FLAG)
+ add_definitions(-Wimplicit-fallthrough)
+ endif()
+
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
# 3.4.1 used there.
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")