diff options
| author | Mark Young <marky@lunarg.com> | 2017-07-12 10:06:19 -0600 |
|---|---|---|
| committer | Mark Young <marky@lunarg.com> | 2017-07-13 13:26:45 -0600 |
| commit | 2bf34098358f45dae1fb3a98a95c33e36e2cf2a0 (patch) | |
| tree | fe8d36a187468db07757c9b9d6c0725332456b23 | |
| parent | 4afb330453f1d681462aa1dee0b4fed49c80c667 (diff) | |
| download | usermoji-2bf34098358f45dae1fb3a98a95c33e36e2cf2a0.tar.xz | |
build: Fix loader/layer fallthrough warning
Change-Id: I04d563caa9000ccbfd5e6e509bf65ceaed9e388a
| -rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ce10e9cd..cc225235 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,13 @@ include_directories("${PROJECT_SOURCE_DIR}/include") if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") set(COMMON_COMPILE_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers") set(COMMON_COMPILE_FLAGS "${COMMON_COMPILE_FLAGS} -fno-strict-aliasing -fno-builtin-memcmp") + + # For GCC version 7.1 or greater, we need to disable the implicit fallthrough warning since + # there's no consistent way to satisfy all compilers until they all accept the C++17 standard + if (CMAKE_COMPILER_IS_GNUCC AND NOT (CMAKE_CXX_COMPILER_VERSION LESS 7.1)) + set(COMMON_COMPILE_FLAGS "${COMMON_COMPILE_FLAGS} -Wimplicit-fallthrough=0") + endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ${COMMON_COMPILE_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_COMPILE_FLAGS} -std=c++11 -fno-rtti") if (UNIX) |
