1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Add -Werror=implicit-fallthrough to CMakeLists.txt

This turns the implicit-fallthrough warning into a full compile-time
error.

Implicit fallthrough is when you forget a break statement in a
case-switch, thus letting one case fall through into the next case and
causing debugging headaches.

This is different from the good type of fallthrough that you use to have
one case with multiple different names, like so:

    case 0:
    case 1:
    case 2:

In that case, it's obvious that you want to have fallthrough there.
This commit is contained in:
Misa 2020-04-17 12:22:43 -07:00 committed by Ethan Lee
parent 8796f2c9e0
commit 57f027e478

View file

@ -150,6 +150,8 @@ ELSEIF(CUSTOM_LEVEL_SUPPORT STREQUAL "DISABLED")
ADD_DEFINITIONS(-DNO_CUSTOM_LEVELS -DNO_EDITOR)
ENDIF()
TARGET_COMPILE_OPTIONS(VVVVVV PRIVATE -Werror=implicit-fallthrough)
# Library information
ADD_LIBRARY(tinyxml-static STATIC ${XML_SRC})
ADD_LIBRARY(physfs-static STATIC ${PFS_SRC} ${PFSP_SRC})