Skip to content

Commit

Permalink
Android ARM static build
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Jun 9, 2023
1 parent a0119fe commit c12279d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions .ci/azure/android_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ jobs:
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
-DANDROID_ABI=$(ANDROID_ABI_CONFIG)
-DANDROID_PLATFORM=$(ANDROID_SDK_VERSION)
-DBUILD_SHARED_LIBS=OFF
-DENABLE_PYTHON=OFF
-DENABLE_SYSTEM_OPENCL=ON
-DENABLE_SYSTEM_PROTOBUF=ON
Expand Down
11 changes: 10 additions & 1 deletion cmake/features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ else()
set(ENABLE_SYSTEM_PUGIXML_DEFAULT OFF)
endif()

if(ANDROID)
# when protobuf from /usr/include is used, then Android toolchain ignores include paths
# but if we build for Android using vcpkg / conan / etc where flatbuffers is not located in
# the /usr/include folders, we can still use 'system' flatbuffers
set(ENABLE_SYSTEM_FLATBUFFERS_DEFAULT OFF)
else()
set(ENABLE_SYSTEM_FLATBUFFERS_DEFAULT ON)
endif()

# users wants to use his own TBB version, specific either via env vars or cmake options
if(DEFINED ENV{TBBROOT} OR DEFINED ENV{TBB_DIR} OR DEFINED TBB_DIR OR DEFINED TBBROOT)
set(ENABLE_SYSTEM_TBB_DEFAULT OFF)
Expand All @@ -163,7 +172,7 @@ ie_dependent_option (ENABLE_SYSTEM_TBB "Enables use of system TBB" ${ENABLE_SYS
# available out of box on all systems (like RHEL, UBI)
ie_option (ENABLE_SYSTEM_PUGIXML "Enables use of system PugiXML" ${ENABLE_SYSTEM_PUGIXML_DEFAULT})
# the option is on by default, because we use only flatc compiler and don't use any libraries
ie_dependent_option(ENABLE_SYSTEM_FLATBUFFERS "Enables use of system flatbuffers" ON
ie_dependent_option(ENABLE_SYSTEM_FLATBUFFERS "Enables use of system flatbuffers" ${ENABLE_SYSTEM_FLATBUFFERS_DEFAULT}
"ENABLE_OV_TF_LITE_FRONTEND" OFF)
ie_dependent_option (ENABLE_SYSTEM_OPENCL "Enables use of system OpenCL" ${ENABLE_SYSTEM_LIBS_DEFAULT}
"ENABLE_INTEL_GPU" OFF)
Expand Down
11 changes: 3 additions & 8 deletions cmake/templates/OpenVINOConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -345,20 +345,15 @@ macro(_ov_find_intel_cpu_dependencies)
if(_OV_ENABLE_CPU_ACL)
if(_ov_as_external_package)
set_and_check(ARM_COMPUTE_LIB_DIR "@PACKAGE_ARM_COMPUTE_LIB_DIR@")
set(_ov_find_acl_options NO_DEFAULT_PATH)
set(_ov_find_acl_path "${CMAKE_CURRENT_LIST_DIR}")
set(ACL_DIR "${CMAKE_CURRENT_LIST_DIR}")
else()
set_and_check(_ov_find_acl_path "@PACKAGE_FIND_ACL_PATH@")
set_and_check(ACL_DIR "@PACKAGE_FIND_ACL_PATH@")
endif()

_ov_find_dependency(ACL
NO_MODULE
PATHS "${_ov_find_acl_path}"
${_ov_find_acl_options})
_ov_find_dependency(ACL)

unset(ARM_COMPUTE_LIB_DIR)
unset(_ov_find_acl_path)
unset(_ov_find_acl_options)
endif()
unset(_OV_ENABLE_CPU_ACL)
endmacro()
Expand Down

0 comments on commit c12279d

Please sign in to comment.