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

Check for GCC7 for implicit-fallthrough support

This commit is contained in:
Ethan Lee 2020-04-23 15:32:34 -04:00
parent 58e512d001
commit ac7ee0e959

View file

@ -150,7 +150,20 @@ ELSEIF(CUSTOM_LEVEL_SUPPORT STREQUAL "DISABLED")
ADD_DEFINITIONS(-DNO_CUSTOM_LEVELS -DNO_EDITOR)
ENDIF()
IF (NOT MSVC)
IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
SET(SUPPORTS_IMPLICIT_FALLTHROUGH 1)
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
IF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
SET(SUPPORTS_IMPLICIT_FALLTHROUGH 1)
ELSE()
SET(SUPPORTS_IMPLICIT_FALLTHROUGH 0)
ENDIF()
ELSE()
SET(SUPPORTS_IMPLICIT_FALLTHROUGH 0)
ENDIF()
IF(SUPPORTS_IMPLICIT_FALLTHROUGH)
TARGET_COMPILE_OPTIONS(VVVVVV PRIVATE -Werror=implicit-fallthrough)
ENDIF()