File: onnxruntime-react-native.podspec

package info (click to toggle)
onnxruntime 1.23.2%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 340,744 kB
  • sloc: cpp: 3,222,135; python: 188,267; ansic: 114,318; asm: 37,927; cs: 36,849; java: 10,962; javascript: 6,811; pascal: 4,126; sh: 2,996; xml: 705; objc: 281; makefile: 67
file content (43 lines) | stat: -rw-r--r-- 1,505 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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 => "15.1" }
  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