X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=cmake%2FQuasselCompileSettings.cmake;h=f2747df36a17f421c8bbb3655a127fd30af8720a;hb=0fdc92b633d25609933314dc4fd942a7ab5dd94a;hp=eb38958ab291f490983049e498e941ea38c2d651;hpb=f5e769ff450b592bc645473e11f9258aec241f0e;p=quassel.git diff --git a/cmake/QuasselCompileSettings.cmake b/cmake/QuasselCompileSettings.cmake index eb38958a..f2747df3 100644 --- a/cmake/QuasselCompileSettings.cmake +++ b/cmake/QuasselCompileSettings.cmake @@ -1,6 +1,6 @@ # This file contains compile flags and general build configuration for Quassel # -# (C) 2014-2019 by the Quassel Project +# (C) 2014-2022 by the Quassel Project # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. @@ -45,6 +45,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") -Wvla -Werror=return-type "$<$:-Werror>" + -Wno-error=deprecated-declarations # Don't break on Qt upgrades -Wno-unknown-pragmas "$<$>:-U_FORTIFY_SOURCE;-D_FORTIFY_SOURCE=2>" ) @@ -82,15 +83,17 @@ elseif(MSVC) # CMake puts /W3 in CMAKE_CXX_FLAGS which will be appended later, so we need to replace string(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - # Silence annoying/useless warnings - # C4127: conditional expression is constant + # Silence warnings that are hard or impossible to avoid + # C4127: conditional expression is constant [in qvector.h as of Qt 5.15.2] set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4127") - # C4244: 'identifier': conversion from 't1' to 't2', possible loss of data - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244") - # C4456: declaration of 'identifier' hides previous local declaration + # C4456: declaration of 'identifier' hides previous local declaration [caused by foreach macro, among others] set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4456") - # C4458: declaration of 'identifier' hides class member + # C4458: declaration of 'identifier' hides class member [caused by MOC for Peer::_id] set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4458") + # C4996: deprecation warnings [unavoidable due to wide range of supported Qt versions] + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996") + # C5240: 'nodiscard': attribute is ignored in this syntactic position [in qcolor.h as of Qt 5.15.2] + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd5240") # Link against the correct version of the C runtime set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt ${CMAKE_EXE_LINKER_FLAGS_RELEASE}")