From 66b2140892cbce5a2c45f1e7a4548929ca8e6530 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 30 Nov 2021 04:27:39 +0000 Subject: [PATCH] build: eliminate C4309 warning from protobuf files with MSVS2017 --- 3rdparty/protobuf/CMakeLists.txt | 2 +- modules/dnn/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/3rdparty/protobuf/CMakeLists.txt b/3rdparty/protobuf/CMakeLists.txt index 6de8148..e39de98 100644 --- a/3rdparty/protobuf/CMakeLists.txt +++ b/3rdparty/protobuf/CMakeLists.txt @@ -13,7 +13,7 @@ if(MSVC) /wd4701 /wd4703 # potentially uninitialized local/pointer variable 'value' used /wd4505 # unreferenced local function has been removed ) - if(MSVC_VERSION LESS 1910) # MSVS 2015 + if(MSVC_VERSION LESS 1920) # MSVS 2015/2017 ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4309) # 'static_cast': truncation of constant value endif() else() diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt index 398ed5b..ba7fe5a 100644 --- a/modules/dnn/CMakeLists.txt +++ b/modules/dnn/CMakeLists.txt @@ -51,7 +51,7 @@ if(MSVC) /wd4305 /wd4127 /wd4100 /wd4512 /wd4125 /wd4389 /wd4510 /wd4610 /wd4702 /wd4456 /wd4457 /wd4065 /wd4310 /wd4661 /wd4506 ) - if(MSVC_VERSION LESS 1910) # MSVS 2015, .pb.cc generated files + if(MSVC_VERSION LESS 1920) # MSVS 2015/2017, .pb.cc generated files ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4309) # 'static_cast': truncation of constant value endif() if(MSVC_VERSION LESS 1920) #