onnxruntime/js/react_native/onnxruntime-react-native.podspec
Changming Sun 3dd6fcc089
Upgrade min ios version to 13.0 (#20773)
To align with Office and other MS products.
Office's support policy is:
"Office for iPad and iPhone is supported on the two most recent versions
of iOS and iPadOS. When a new version of iOS or iPadOS is released, the
Office Operating System requirement becomes the two most recent
versions: the new version of iOS or iPadOS and the previous version."
(from https://products.office.com/office-system-requirements)

The latest iOS version is 17. So they support both 17 and 16. Here I set
our min iOS version to 13 so that it will be a superset of what Office
supports.

This change would allow us using C++17's std::filesystem feature in the
core framework. The modifications were generated by running
```bash
 find . -type f -exec sed -i "s/apple_deploy_target[ =]12.0/apple_deploy_target=13.0/g"  {} \;
```

Cannot use 15.0 because otherwise iOS packaging would fail with:

```
/Users/runner/work/1/b/apple_framework/intermediates/iphoneos_arm64/Release/_deps/coremltools-src/mlmodel/src/MILBlob/Util/Span.hpp:288:9: error: cannot use 'throw' with exceptions disabled
        MILVerifyIsTrue(index < Size(), std::range_error, "index out of bounds");
```

The Google OSS libraries we use only officially support iOS 15+.
2024-06-04 10:15:20 -07:00

43 lines
1.5 KiB
Ruby

require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
# Expect to return the absolute path of the react native root project dir
root_dir = File.dirname(File.dirname(__dir__))
Pod::Spec.new do |spec|
spec.static_framework = true
spec.name = "onnxruntime-react-native"
spec.version = package["version"]
spec.summary = package["description"]
spec.homepage = package["homepage"]
spec.license = package["license"]
spec.authors = package["author"]
spec.platforms = { :ios => "13.0" }
spec.source = { :git => "https://github.com/Microsoft/onnxruntime.git", :tag => "rel-#{spec.version}" }
spec.source_files = "ios/*.{h,mm}"
spec.dependency "React-Core"
spec.dependency "onnxruntime-c"
spec.xcconfig = {
'OTHER_CPLUSPLUSFLAGS' => '-Wall -Wextra',
}
if (File.exist?(File.join(root_dir, 'package.json')))
# Read the react native root project directory package.json file
root_package = JSON.parse(File.read(File.join(root_dir, 'package.json')))
if (root_package["onnxruntimeExtensionsEnabled"] == 'true')
spec.dependency "onnxruntime-extensions-c"
spec.xcconfig = {
'OTHER_CPLUSPLUSFLAGS' => '-DORT_ENABLE_EXTENSIONS=1 -Wall -Wextra',
}
end
else
puts "Could not find package.json file in the expected directory: #{root_dir}. ONNX Runtime Extensions will not be enabled."
end
end