diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c3f69e..151eb29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,7 @@ if (ENABLE_CUSTOM_COMPILER_FLAGS) -Wunused-macros -Wmissing-variable-declarations -Wused-but-marked-unused + -Wswitch-enum ) endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 47d7c1a..d69f3f8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,6 +25,14 @@ if(ENABLE_CJSON_TEST) target_compile_options(unity PRIVATE "-fno-sanitize=float-divide-by-zero") endif() endif() + # Disable -Wswitch-enum for Unity + if (FLAG_SUPPORTED_Wswitchenum) + if ("${CMAKE_VERSION}" VERSION_LESS "2.8.12") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-switch-enum") + else() + target_compile_options(unity PRIVATE "-Wno-switch-enum") + endif() + endif() #copy test files file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/inputs")