Skip to content

Commit eb152d7

Browse files
author
Maxim Pashchenkov
authored
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
1 parent 83afd09 commit eb152d7

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

modules/gapi/CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ ocv_add_module(gapi
2929
)
3030

3131
if(MSVC)
32-
# Disable obsollete warning C4503 popping up on MSVC <<2017
33-
# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4503?view=vs-2019
34-
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4503)
35-
if (OPENCV_GAPI_INF_ENGINE AND NOT INF_ENGINE_RELEASE VERSION_GREATER "2021000000")
36-
# Disable IE deprecated code warning C4996 for releases < 2021.1
37-
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4996)
32+
if(MSVC_VERSION LESS 1910)
33+
# Disable obsolete warning C4503 popping up on MSVC << 15 2017
34+
# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4503?view=vs-2019
35+
# and IE deprecated code warning C4996
36+
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4503 /wd4996)
3837
endif()
3938
endif()
4039

0 commit comments

Comments
 (0)