Apply Apivalidator to extra TBB libs (#15998)
This commit is contained in:
parent
1ddb6797ab
commit
627339e5f2
|
|
@ -75,7 +75,7 @@ function(_ov_add_api_validator_post_build_step)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
cmake_parse_arguments(API_VALIDATOR "" "TARGET" "" ${ARGN})
|
cmake_parse_arguments(API_VALIDATOR "" "TARGET" "EXTRA" "" ${ARGN})
|
||||||
|
|
||||||
if(NOT API_VALIDATOR_TARGET)
|
if(NOT API_VALIDATOR_TARGET)
|
||||||
message(FATAL_ERROR "RunApiValidator requires TARGET to validate!")
|
message(FATAL_ERROR "RunApiValidator requires TARGET to validate!")
|
||||||
|
|
@ -86,8 +86,12 @@ function(_ov_add_api_validator_post_build_step)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# collect targets
|
# collect targets
|
||||||
|
|
||||||
_ie_add_api_validator_post_build_step_recursive(TARGET ${API_VALIDATOR_TARGET})
|
_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
|
# remove targets which were tested before
|
||||||
foreach(item IN LISTS VALIDATED_TARGETS)
|
foreach(item IN LISTS VALIDATED_TARGETS)
|
||||||
|
|
@ -99,7 +103,6 @@ function(_ov_add_api_validator_post_build_step)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# apply check
|
# apply check
|
||||||
|
|
||||||
macro(api_validator_get_target_name)
|
macro(api_validator_get_target_name)
|
||||||
get_target_property(is_imported ${target} IMPORTED)
|
get_target_property(is_imported ${target} IMPORTED)
|
||||||
get_target_property(orig_target ${target} ALIASED_TARGET)
|
get_target_property(orig_target ${target} ALIASED_TARGET)
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,23 @@ macro(ov_find_package_tbb)
|
||||||
list(APPEND TBB_IMPORTED_TARGETS ${target})
|
list(APPEND TBB_IMPORTED_TARGETS ${target})
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
if(WIN32 AND TARGET TBB::tbbbind_2_5)
|
||||||
|
# Add HWLOC::hwloc_2_5 target to check via Apivalidator
|
||||||
|
get_target_property(TBB_location TBB::tbb IMPORTED_LOCATION_RELEASE)
|
||||||
|
get_filename_component(TBB_dir "${TBB_location}" DIRECTORY)
|
||||||
|
set(hwloc_dll_name "${CMAKE_SHARED_LIBRARY_PREFIX}hwloc${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
|
find_file(HWLOC_DLL NAMES ${hwloc_dll_name} PATHS "${TBB_dir}" DOC "Path to hwloc.dll")
|
||||||
|
|
||||||
|
if(NOT HWLOC_DLL)
|
||||||
|
message(FATAL_ERROR "Failed to find ${hwloc_dll_name} in ${TBB_dir}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_library(HWLOC::hwloc_2_5 SHARED IMPORTED)
|
||||||
|
set_property(TARGET HWLOC::hwloc_2_5 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||||
|
set_target_properties(HWLOC::hwloc_2_5 PROPERTIES
|
||||||
|
IMPORTED_LOCATION_RELEASE "${HWLOC_DLL}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT TBB_FOUND)
|
if(NOT TBB_FOUND)
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ set_ie_threading_interface_for(${TARGET_NAME})
|
||||||
ie_mark_target_as_cc(${TARGET_NAME})
|
ie_mark_target_as_cc(${TARGET_NAME})
|
||||||
|
|
||||||
# must be called after all target_link_libraries
|
# 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})
|
||||||
|
|
||||||
# LTO
|
# LTO
|
||||||
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
|
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue