Skip to content

Commit 107bbdd

Browse files
Fixed regression with apiValidator search (#25252)
### Details: - Regression after #25069 - With `function` some vars are bounded to its scope, while they are required for functions below
1 parent 07cbea2 commit 107bbdd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cmake/developer_package/api_validator/api_validator.cmake

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

5-
function(ov_search_api_validator)
5+
macro(ov_search_api_validator)
66
if(NOT ENABLE_API_VALIDATOR)
77
return()
88
endif()
@@ -15,8 +15,6 @@ function(ov_search_api_validator)
1515
string(REPLACE "\\" "" WINDOWS_SDK_VERSION $ENV{WindowsSDKVersion})
1616
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION ${WINDOWS_SDK_VERSION})
1717
message(STATUS "Use ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} Windows SDK version")
18-
# set to parent scope as well for later usage in '_ov_add_api_validator_post_build_step'
19-
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION ${WINDOWS_SDK_VERSION} PARENT_SCOPE)
2018
else()
2119
message(FATAL_ERROR "WindowsSDKVersion environment variable is not set,\
2220
can't find Windows SDK version. Try to use vcvarsall.bat script")
@@ -47,9 +45,12 @@ can't find Windows SDK version. Try to use vcvarsall.bat script")
4745
message(STATUS "Found apivalidator: ${ONECORE_API_VALIDATOR}")
4846
endif()
4947
endif()
50-
endfunction()
48+
endmacro()
49+
5150

52-
ov_search_api_validator()
51+
if(ENABLE_API_VALIDATOR)
52+
ov_search_api_validator()
53+
endif()
5354

5455
function(_ov_add_api_validator_post_build_step_recursive)
5556
cmake_parse_arguments(API_VALIDATOR "" "TARGET" "" ${ARGN})

0 commit comments

Comments
 (0)