1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-31 18:24:25 +03:00

Added -Wimplicit-fallthrough

Added compiler flag to check for fall through in case statements.
This commit is contained in:
mkaruza
2018-12-31 15:04:10 +01:00
parent 7e9419e811
commit b9f371c269
4 changed files with 18 additions and 4 deletions

View File

@ -5,6 +5,7 @@
cmake_minimum_required (VERSION 2.8)
project (wsrep-lib)
include(CheckIncludeFile)
include(CheckCXXCompilerFlag)
# Options
@ -29,6 +30,11 @@ option(WSREP_LIB_STRICT_BUILD_FLAGS "Compile with strict build flags")
# CXX flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Woverloaded-virtual -g")
CHECK_CXX_COMPILER_FLAG("-Wimplicit-fallthrough" COMPILER_SUPPORTS_IMPLICIT_FALLTHROUGH)
if (COMPILER_SUPPORTS_IMPLICIT_FALLTHROUGH)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wimplicit-fallthrough")
endif()
if (WSREP_LIB_STRICT_BUILD_FLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weffc++")
endif()