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
This commit is contained in:
Maxim Pashchenkov 2021-10-28 21:19:46 +03:00 committed by GitHub
parent 83afd09f13
commit eb152d7431
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()