# Copyright (c) 2023 Xiaomi Corporation (authors: Fangjun Kuang) | |
# https://onnxruntime.ai/docs/build/ios.html | |
num_jobs=3 | |
# Get directory this script is in | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
build_dir=$DIR/build-ios/arm64 | |
#requires python3.6 or higher | |
python3 \ | |
$DIR/tools/ci_build/build.py \ | |
--build_dir $build_dir \ | |
--include_ops_by_config ops.config --skip_tests \ | |
--config Release \ | |
--use_xcode \ | |
--cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF \ | |
--cmake_extra_defines onnxruntime_BUILD_SHARED_LIB=OFF \ | |
--cmake_extra_defines CMAKE_INSTALL_PREFIX=$build_dir/install/ \ | |
--ios \ | |
--ios_sysroot iphoneos \ | |
--osx_arch arm64 \ | |
--target install \ | |
--parallel $num_jobs \ | |
--skip_tests \ | |
--build_apple_framework \ | |
--apple_deploy_target 13.0 \ | |
--use_coreml \ | |
--path_to_protoc_exe /usr/local/Cellar/protobuf@21/21.12/bin/protoc-3.21.12.0 | |