Configure build to work with case fallthrough GCC7 warning. Refs #671

This commit is contained in:
baldurk
2017-06-22 14:13:58 +01:00
parent 31f67f4c19
commit 094b9ebf35
3 changed files with 16 additions and 0 deletions
+6
View File
@@ -181,6 +181,12 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-Wno-reorder)
if(CMAKE_COMPILER_IS_GNUCXX)
list(APPEND warning_flags -Wno-unused-but-set-variable)
# We keep the implicit fallthrough warning for now, but allow more
# comments to silence it.
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
list(APPEND warning_flags -Wimplicit-fallthrough=2)
endif()
endif()
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
+5
View File
@@ -114,6 +114,11 @@ file(WRITE
"OSX_ICONFILE=${CMAKE_CURRENT_BINARY_DIR}/RenderDoc.icns\n")
# propagate build version info. Lots of escaping needed here to pass ""s into the define value
if(CMAKE_COMPILER_IS_GNUCXX)
file(APPEND
${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
"QMAKE_CXXFLAGS+=-Wno-unknown-warning -Wno-implicit-fallthrough\n")
endif()
file(APPEND
${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+5
View File
@@ -201,6 +201,11 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR APPLE)
# -Wno-shift-negative-value available
set_source_files_properties(3rdparty/jpeg-compressor/jpgd.cpp
PROPERTIES COMPILE_FLAGS "-Wno-unknown-warning-option -Wno-shift-negative-value")
if(CMAKE_COMPILER_IS_GNUCXX)
set_property(SOURCE 3rdparty/jpeg-compressor/jpgd.cpp
APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-unknown-warning -Wno-implicit-fallthrough")
endif()
endif()
add_library(rdoc OBJECT ${sources})