From eb152d7431462579efd6873e94eae7c20453611f Mon Sep 17 00:00:00 2001 From: Maxim Pashchenkov Date: Thu, 28 Oct 2021 21:19:46 +0300 Subject: [PATCH] Merge pull request #20937 from mpashchenkov:mp/ocv-gapi-warnings G-API: Disable Windows warnings with 4996 code * Windows warnings 4503 and 4996 are disabled with dnn style * Applying comments to review * Reproducing * Added check MSVC_VERSION for both warnings --- modules/gapi/CMakeLists.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/gapi/CMakeLists.txt b/modules/gapi/CMakeLists.txt index 61ab5397d7..185f5c6639 100644 --- a/modules/gapi/CMakeLists.txt +++ b/modules/gapi/CMakeLists.txt @@ -29,12 +29,11 @@ ocv_add_module(gapi ) if(MSVC) - # Disable obsollete warning C4503 popping up on MSVC <<2017 - # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4503?view=vs-2019 - ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4503) - if (OPENCV_GAPI_INF_ENGINE AND NOT INF_ENGINE_RELEASE VERSION_GREATER "2021000000") - # Disable IE deprecated code warning C4996 for releases < 2021.1 - ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4996) + if(MSVC_VERSION LESS 1910) + # Disable obsolete warning C4503 popping up on MSVC << 15 2017 + # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4503?view=vs-2019 + # and IE deprecated code warning C4996 + ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4503 /wd4996) endif() endif()