diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-06-11 11:40:26 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-06-11 09:43:25 +0000 |
commit | c09e770a5d3932e8d3cd91d97f75fcb7e7cceebd (patch) | |
tree | a2aca170a6c23f5ed755816e9d3a4a20d75c73db | |
parent | 449eee2d108589d2b8549d6682c8b5e792e659b8 (diff) |
Add appropriate MSVC version check for warnings are errors feature
In qmake land warnings_are_errors is only enabled for specific
MSVC versions, ending with MSVC2015. Presumably the warnings have not
yet been fixed for newer MSVC versions, so we stick with the same
status quo for now.
Change-Id: Idc3741d39c888f77ed324a5eb8c654416591785f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | cmake/QtInternalTargets.cmake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index 083be94ab4..f289326de0 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -48,8 +48,12 @@ function(qt_internal_set_warnings_are_errors_flags target) endif() endif() elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") - # using Visual Studio C++ - target_compile_options("${target}" INTERFACE /WX) + # In qmake land, currently warnings as errors are only enabled for + # MSVC 2012, 2013, 2015. + # Respectively MSVC_VERRSIONs are: 1700-1799, 1800-1899, 1900-1909. + if(MSVC_VERSION GREATER_EQUAL 1700 AND MSVC_VERSION LESS_EQUAL 1909) + target_compile_options("${target}" INTERFACE /WX) + endif() endif() endfunction() |