From 3128f2d1723458d9c6c30ac664f83e431237742d Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Thu, 27 Jun 2024 23:50:53 +0400 Subject: [PATCH] Fixed regression with apiValidator search (#25252) ### Details: - Regression after https://github.com/openvinotoolkit/openvino/pull/25069 - With `function` some vars are bounded to its scope, while they are required for functions below --- .../api_validator/api_validator.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmake/developer_package/api_validator/api_validator.cmake b/cmake/developer_package/api_validator/api_validator.cmake index 68e6d1fccb5e7d..ff6b0fbaa061e9 100644 --- a/cmake/developer_package/api_validator/api_validator.cmake +++ b/cmake/developer_package/api_validator/api_validator.cmake @@ -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() @@ -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") @@ -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})