Skip to content

Commit

Permalink
Apply Apivalidator to extra TBB and TBBBind libs
Browse files Browse the repository at this point in the history
  • Loading branch information
vurusovs committed Feb 27, 2023
1 parent a7443e1 commit 78f01da
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions cmake/developer_package/api_validator/api_validator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function(_ov_add_api_validator_post_build_step)
message(FATAL_ERROR "Internal error: apiValidator is found (${ONECORE_API_VALIDATOR}), but UniversalDDIs.xml file has not been found for ${wdk_platform} platform")
endif()

cmake_parse_arguments(API_VALIDATOR "" "TARGET" "" ${ARGN})
cmake_parse_arguments(API_VALIDATOR "" "TARGET" "EXTRA" "" ${ARGN})

if(NOT API_VALIDATOR_TARGET)
message(FATAL_ERROR "RunApiValidator requires TARGET to validate!")
Expand All @@ -108,8 +108,12 @@ function(_ov_add_api_validator_post_build_step)
endif()

# collect targets

_ie_add_api_validator_post_build_step_recursive(TARGET ${API_VALIDATOR_TARGET})
if (API_VALIDATOR_EXTRA)
foreach(target IN LISTS API_VALIDATOR_EXTRA)
_ie_add_api_validator_post_build_step_recursive(TARGET ${target})
endforeach()
endif()

# remove targets which were tested before
foreach(item IN LISTS VALIDATED_TARGETS)
Expand All @@ -121,7 +125,6 @@ function(_ov_add_api_validator_post_build_step)
endif()

# apply check

macro(api_validator_get_target_name)
get_target_property(is_imported ${target} IMPORTED)
get_target_property(orig_target ${target} ALIASED_TARGET)
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/ie_parallel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ macro(ov_find_package_tbb)

# WA for oneTBB: it does not define TBB_IMPORTED_TARGETS
if(TBB_FOUND AND NOT TBB_IMPORTED_TARGETS)
foreach(target TBB::tbb TBB::tbbmalloc TBB::tbbbind_2_5)
foreach(target TBB::tbb TBB::tbbmalloc TBB::tbbmalloc_proxy TBB::tbbbind_2_5)
if(TARGET ${target})
list(APPEND TBB_IMPORTED_TARGETS ${target})
endif()
Expand Down
1 change: 1 addition & 0 deletions src/cmake/openvino.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ add_library(openvino::runtime ALIAS ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME runtime)

ie_add_vs_version_file(NAME ${TARGET_NAME} FILEDESCRIPTION "OpenVINO runtime library")
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})

target_include_directories(${TARGET_NAME} PUBLIC
$<BUILD_INTERFACE:${OpenVINO_SOURCE_DIR}/src/core/include>
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_cpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ cross_compiled_file(${TARGET_NAME}
)

# must be called after all target_link_libraries
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME} EXTRA ${TBB_IMPORTED_TARGETS} ${TBBBIND_2_5_IMPORTED_TARGETS})

# add test object library

Expand Down

0 comments on commit 78f01da

Please sign in to comment.