From f3fa0456815c78474be36bb2e9a7e18f6b703aa8 Mon Sep 17 00:00:00 2001 From: Rachel Guo <35738743+YUNQIUGUO@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:50:42 -0800 Subject: [PATCH] Enable MacOS build in ORT Objc Pod (#18786) ### Description Add macos build for objc pod. ### Motivation and Context Follow up pr for #18550 --------- Co-authored-by: rachguo --- .../github/apple/objectivec/assemble_objc_pod_package.py | 1 + .../ci_build/github/apple/objectivec/objc.podspec.template | 6 ++++++ .../templates/stages/mac-ios-packaging-build-stage.yml | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/ci_build/github/apple/objectivec/assemble_objc_pod_package.py b/tools/ci_build/github/apple/objectivec/assemble_objc_pod_package.py index ec1feaae82..ef2b645f98 100755 --- a/tools/ci_build/github/apple/objectivec/assemble_objc_pod_package.py +++ b/tools/ci_build/github/apple/objectivec/assemble_objc_pod_package.py @@ -154,6 +154,7 @@ def assemble_objc_pod_package( "DESCRIPTION": pod_config["description"], "INCLUDE_DIR_LIST": path_patterns_as_variable_value(include_dirs), "IOS_DEPLOYMENT_TARGET": framework_info["iphonesimulator"]["APPLE_DEPLOYMENT_TARGET"], + "MACOSX_DEPLOYMENT_TARGET": framework_info.get("macosx", {}).get("APPLE_DEPLOYMENT_TARGET", ""), "LICENSE_FILE": license_file, "NAME": pod_name, "PUBLIC_HEADER_FILE_LIST": path_patterns_as_variable_value(pod_files["public_header_files"]), diff --git a/tools/ci_build/github/apple/objectivec/objc.podspec.template b/tools/ci_build/github/apple/objectivec/objc.podspec.template index 8832b939f4..b90ae4f8f2 100644 --- a/tools/ci_build/github/apple/objectivec/objc.podspec.template +++ b/tools/ci_build/github/apple/objectivec/objc.podspec.template @@ -8,6 +8,12 @@ Pod::Spec.new do |s| s.author = { "ONNX Runtime" => "onnxruntime@microsoft.com" } s.source = { :http => "file:///http_source_placeholder" } s.ios.deployment_target = "@IOS_DEPLOYMENT_TARGET@" + + macosx_deployment_target = "@MACOSX_DEPLOYMENT_TARGET@" + if macosx_deployment_target != "" + s.osx.deployment_target = macosx_deployment_target + end + s.preserve_paths = [ "@LICENSE_FILE@" ] s.default_subspec = "Core" s.static_framework = true diff --git a/tools/ci_build/github/azure-pipelines/templates/stages/mac-ios-packaging-build-stage.yml b/tools/ci_build/github/azure-pipelines/templates/stages/mac-ios-packaging-build-stage.yml index 1a7915172e..d1dff0769e 100644 --- a/tools/ci_build/github/azure-pipelines/templates/stages/mac-ios-packaging-build-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/stages/mac-ios-packaging-build-stage.yml @@ -38,7 +38,7 @@ stages: cPodName: onnxruntime-training-c objcPodName: onnxruntime-training-objc - timeoutInMinutes: 180 + timeoutInMinutes: 210 steps: - script: |