-# For MSVC, at least do a version sanity check...
-elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
- if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.0")
- message(FATAL_ERROR "Your compiler is too old; you need at least Visual Studio 2015 (MSVC 19.0+), GCC 4.8+, Clang 3.3+, or any other compiler with full C++11 support.")
- endif()
+ # 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")
+ # 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 [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")