MSVC: Enable warnings-are-errors for latest Visual Studio 2019

Also remove handling of older versions, because we only support
Visual Studio 2019 currently

Pick-to: 6.2
Change-Id: If66a46d970047fe25582e323df74e0a904ee92da
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Kai Köhne 2021-05-27 08:19:04 +02:00
parent 7efacc7cbe
commit d0676874d6

View File

@ -70,10 +70,9 @@ function(qt_internal_set_warnings_are_errors_flags target)
endif() endif()
endif() endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# In qmake land, currently warnings as errors are only enabled for # Only enable for versions of MSVC that are known to work
# MSVC 2012, 2013, 2015. # 1929 is Visual Studio 2019 version 16.0
# Respectively MSVC_VERRSIONs are: 1700-1799, 1800-1899, 1900-1909. if(MSVC_VERSION LESS_EQUAL 1929)
if(MSVC_VERSION GREATER_EQUAL 1700 AND MSVC_VERSION LESS_EQUAL 1909)
list(APPEND flags /WX) list(APPEND flags /WX)
endif() endif()
endif() endif()