Skip to content

Commit

Permalink
Ability to disable ApiVdalidator search (openvinotoolkit#25069)
Browse files Browse the repository at this point in the history
### Details:
 - In some cases API validator search is not robust 

### Tickets:
 - Closes microsoft/vcpkg#38221
  • Loading branch information
ilya-lavrenov authored and allnes committed Jun 26, 2024
1 parent 33a51b0 commit ab2ba77
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cmake/developer_package/api_validator/api_validator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
# SPDX-License-Identifier: Apache-2.0
#

if(WIN32)
function(ov_search_api_validator)
if(NOT ENABLE_API_VALIDATOR)
return()
endif()

# CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION is only set when
# Visual Studio generators are used, but we need it
# when we use Ninja as well
Expand All @@ -11,8 +15,10 @@ if(WIN32)
string(REPLACE "\\" "" WINDOWS_SDK_VERSION $ENV{WindowsSDKVersion})
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION ${WINDOWS_SDK_VERSION})
message(STATUS "Use ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} Windows SDK version")
# set to parent scope as well for later usage in '_ov_add_api_validator_post_build_step'
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION ${WINDOWS_SDK_VERSION} PARENT_SCOPE)
else()
message(FATAL_ERROR "WindowsSDKVersion environment variable is not set,\
message(FATAL_ERROR "WindowsSDKVersion environment variable is not set,\
can't find Windows SDK version. Try to use vcvarsall.bat script")
endif()
endif()
Expand Down Expand Up @@ -41,7 +47,9 @@ can't find Windows SDK version. Try to use vcvarsall.bat script")
message(STATUS "Found apivalidator: ${ONECORE_API_VALIDATOR}")
endif()
endif()
endif()
endfunction()

ov_search_api_validator()

function(_ov_add_api_validator_post_build_step_recursive)
cmake_parse_arguments(API_VALIDATOR "" "TARGET" "" ${ARGN})
Expand Down
2 changes: 2 additions & 0 deletions cmake/features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ ov_dependent_option(ENABLE_JS "Enables JS API building" ON "NOT ANDROID;NOT EMSC

ov_option(ENABLE_OPENVINO_DEBUG "Enable output for OPENVINO_DEBUG statements" OFF)

ov_dependent_option (ENABLE_API_VALIDATOR "Enables API Validator usage" ON "WIN32" OFF)

if(NOT BUILD_SHARED_LIBS AND ENABLE_OV_TF_FRONTEND)
set(FORCE_FRONTENDS_USE_PROTOBUF ON)
else()
Expand Down

0 comments on commit ab2ba77

Please sign in to comment.