Skip to content

Commit

Permalink
Fixed regression with apiValidator search (openvinotoolkit#25252)
Browse files Browse the repository at this point in the history
### Details:
- Regression after
openvinotoolkit#25069
- With `function` some vars are bounded to its scope, while they are
required for functions below
  • Loading branch information
ilya-lavrenov authored Jun 27, 2024
1 parent 07cbea2 commit 107bbdd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cmake/developer_package/api_validator/api_validator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
#

function(ov_search_api_validator)
macro(ov_search_api_validator)
if(NOT ENABLE_API_VALIDATOR)
return()
endif()
Expand All @@ -15,8 +15,6 @@ function(ov_search_api_validator)
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,\
can't find Windows SDK version. Try to use vcvarsall.bat script")
Expand Down Expand Up @@ -47,9 +45,12 @@ can't find Windows SDK version. Try to use vcvarsall.bat script")
message(STATUS "Found apivalidator: ${ONECORE_API_VALIDATOR}")
endif()
endif()
endfunction()
endmacro()


ov_search_api_validator()
if(ENABLE_API_VALIDATOR)
ov_search_api_validator()
endif()

function(_ov_add_api_validator_post_build_step_recursive)
cmake_parse_arguments(API_VALIDATOR "" "TARGET" "" ${ARGN})
Expand Down

0 comments on commit 107bbdd

Please sign in to comment.