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:
parent
58e512d001
commit
ac7ee0e959
1 changed files with 14 additions and 1 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue