Skip to content

Commit

Permalink
Silence some recent gcc warnings which we can't fix
Browse files Browse the repository at this point in the history
Since the fixes for these are either outside our control (residing
in Qt system headers), or break compatiblity with older compiler
versions which we still support.
  • Loading branch information
nyalldawson committed Sep 23, 2019
1 parent 425afaa commit 869ee9b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Expand Up @@ -531,11 +531,23 @@ IF (PEDANTIC)
ELSE (MSVC)
# add warnings via flags (not as definitions as on Mac -Wall can not be overridden per language )
SET(_warnings "-Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing")

SET(WERROR FALSE CACHE BOOL "Treat build warnings as errors.")
IF (WERROR)
SET(_warnings "${_warnings} -Werror")
ENDIF(WERROR)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_warnings}")

# c++ only warnings

# unavoidable - we can't avoid these, as older, supported compilers do not support removing the redundant move
SET(_warnings "${_warnings} -Wno-redundant-move")

IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
# heaps of these thrown by Qt headers at the moment (sep 2019)
SET(_warnings "${_warnings} -Wno-deprecated-copy")
ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_warnings}")

# Qt produces lots of warnings with strict aliasing (as of Qt 4.4.0 & GCC 4.3)
Expand Down

0 comments on commit 869ee9b

Please sign in to comment.