From a1825980c496eb100e719a918ab2cc9f96389f52 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Wed, 6 Oct 2021 17:28:48 +0200 Subject: [PATCH] Define OpenMW specific C++ flags --- CI/before_script.linux.sh | 1 + CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CI/before_script.linux.sh b/CI/before_script.linux.sh index bc0eb0013d..5d20fa75ce 100755 --- a/CI/before_script.linux.sh +++ b/CI/before_script.linux.sh @@ -32,6 +32,7 @@ declare -a CMAKE_CONF_OPTS=( -DCMAKE_INSTALL_PREFIX=install -DCMAKE_C_FLAGS='-Werror' -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" + -DOPENMW_CXX_FLAGS="-Werror=implicit-fallthrough" ) if [[ $CI_OPENMW_USE_STATIC_DEPS ]]; then diff --git a/CMakeLists.txt b/CMakeLists.txt index ae4584a4cd..2564379847 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -543,8 +543,8 @@ if (BUILD_OPENCS) add_subdirectory (extern/osgQt) endif() -if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=implicit-fallthrough") +if (OPENMW_CXX_FLAGS) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPENMW_CXX_FLAGS}") endif() # Components