Improvements for OSX build (#13201)

* Hide some helper variables as internal ones

* Added an ability to test private API for TF FE

* OSX improvements

* Fixed project generation for xcode
This commit is contained in:
Ilya Lavrenov 2022-09-26 07:48:41 +04:00 committed by GitHub
parent d82cdc39e4
commit 12f1e95c3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 12 deletions

View File

@ -177,8 +177,11 @@ function(ov_download_tbbbind_2_5)
ENVIRONMENT "TBBBIND_2_5_ROOT" ENVIRONMENT "TBBBIND_2_5_ROOT"
SHA256 "865e7894c58402233caf0d1b288056e0e6ab2bf7c9d00c9dc60561c484bc90f4") SHA256 "865e7894c58402233caf0d1b288056e0e6ab2bf7c9d00c9dc60561c484bc90f4")
else() else()
message(WARNING "prebuilt TBBBIND_2_5 is not available. # TMP: for Apple Silicon TBB does not provide TBBBind
if(NOT (APPLE AND AARCH64))
message(WARNING "prebuilt TBBBIND_2_5 is not available.
Build oneTBB from sources and set TBBROOT environment var before OpenVINO cmake configure") Build oneTBB from sources and set TBBROOT environment var before OpenVINO cmake configure")
endif()
return() return()
endif() endif()

View File

@ -79,6 +79,11 @@ if(NOT COMMAND find_host_package)
find_package(${ARGN}) find_package(${ARGN})
endmacro() endmacro()
endif() endif()
if(NOT COMMAND find_host_library)
macro(find_host_library)
find_library(${ARGN})
endmacro()
endif()
if(NOT COMMAND find_host_program) if(NOT COMMAND find_host_program)
macro(find_host_program) macro(find_host_program)
find_program(${ARGN}) find_program(${ARGN})

View File

@ -56,13 +56,23 @@ endif()
# Since we were able to find_package(Clang) in a separate process # Since we were able to find_package(Clang) in a separate process
# let's try to find in current process # let's try to find in current process
if(ENABLE_NCC_STYLE) if(ENABLE_NCC_STYLE)
find_host_package(Clang QUIET) if(APPLE)
find_host_library(libclang_location NAMES clang
PATHS /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib
DOC "Path to clang library")
else()
find_host_package(Clang QUIET)
endif()
if(Clang_FOUND AND TARGET libclang) if(Clang_FOUND AND TARGET libclang)
get_target_property(libclang_location libclang LOCATION) get_target_property(libclang_location libclang LOCATION)
message(STATUS "Found libclang: ${libclang_location}") endif()
else()
if(NOT libclang_location)
message(WARNING "clang-${clang_version} libclang-${clang_version}-dev are not found (required for ncc naming style check)") message(WARNING "clang-${clang_version} libclang-${clang_version}-dev are not found (required for ncc naming style check)")
set(ENABLE_NCC_STYLE OFF) set(ENABLE_NCC_STYLE OFF)
else()
message(STATUS "Found libclang: ${libclang_location}")
endif() endif()
endif() endif()

View File

@ -38,8 +38,9 @@ if(_ov_dynamic_tbbbind_2_5_found)
message(STATUS "Static tbbbind_2_5 package usage is disabled, since oneTBB (ver. ${TBB_VERSION}) provides dynamic TBBBind 2.5") message(STATUS "Static tbbbind_2_5 package usage is disabled, since oneTBB (ver. ${TBB_VERSION}) provides dynamic TBBBind 2.5")
set(ENABLE_TBBBIND_2_5 OFF) set(ENABLE_TBBBIND_2_5 OFF)
elseif(ENABLE_TBBBIND_2_5) elseif(ENABLE_TBBBIND_2_5)
if(TBB_VERSION VERSION_GREATER_EQUAL 2021) # TMP: for Apple Silicon TBB does not provide TBBBind
message(STATUS "oneTBB (ver. ${TBB_VERSION}) is used, but dynamic TBBBind 2.5 is not found. Use custom static TBBBind 2.5") if(TBB_VERSION VERSION_GREATER_EQUAL 2021 AND NOT (APPLE AND AARCH64))
message(STATUS "oneTBB (ver. ${TBB_VERSION}) is used, but dynamic TBBBind 2.5+ is not found. Use custom static TBBBind 2.5")
endif() endif()
# download and find a prebuilt version of TBBBind_2_5 # download and find a prebuilt version of TBBBind_2_5

View File

@ -50,12 +50,9 @@ else()
set(FRONTEND_LIB_SUFFIX "${FRONTEND_LIB_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}${OpenVINO_VERSION_SUFFIX}") set(FRONTEND_LIB_SUFFIX "${FRONTEND_LIB_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}${OpenVINO_VERSION_SUFFIX}")
endif() endif()
set_property(SOURCE target_compile_definitions(${TARGET_NAME}_obj PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src/plugin_loader.cpp FRONTEND_LIB_PREFIX="${CMAKE_SHARED_LIBRARY_PREFIX}${FRONTEND_NAME_PREFIX}"
${CMAKE_CURRENT_SOURCE_DIR}/src/manager.cpp FRONTEND_LIB_SUFFIX="${FRONTEND_LIB_SUFFIX}")
APPEND PROPERTY COMPILE_DEFINITIONS
FRONTEND_LIB_PREFIX="${CMAKE_SHARED_LIBRARY_PREFIX}${FRONTEND_NAME_PREFIX}"
FRONTEND_LIB_SUFFIX="${FRONTEND_LIB_SUFFIX}")
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}_obj) add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}_obj)