native_vision.podspec 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #
  2. # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
  3. # Run `pod lib lint native_vision.podspec` to validate before publishing.
  4. #
  5. Pod::Spec.new do |s|
  6. s.name = 'native_vision'
  7. s.version = '0.0.5'
  8. s.summary = 'A new Flutter plugin project.'
  9. s.description = <<-DESC
  10. A new Flutter plugin project.
  11. DESC
  12. s.homepage = 'http://example.com'
  13. s.license = { :file => '../LICENSE' }
  14. s.author = { 'Your Company' => 'email@example.com' }
  15. s.source = { :path => '.' }
  16. s.source_files = 'Classes/**/*', 'cross_plat_cpp/**/*.{h,hpp,cpp,c}'
  17. s.private_header_files = 'Classes/**/*.hpp', 'cross_plat_cpp/**/*.{hpp,h}'
  18. s.dependency 'Flutter'
  19. s.platform = :ios, '9.0'
  20. s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
  21. # Flutter.framework does not contain a i386 slice.
  22. s.pod_target_xcconfig = {
  23. 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 arm64',
  24. }
  25. # s.module_map = false
  26. s.swift_version = '5.0'
  27. # s.subspec 'Torch' do |ss|
  28. ## https://medium.com/@khaifunglim97/how-to-build-a-flutter-app-with-c-c-libraries-via-ffi-on-android-and-ios-including-opencv-1e2124e85019
  29. ## Fixed the issue that does not find the headers when use_framework is enabled in above link.
  30. ## https://github.com/pytorch/pytorch/issues/49406#issuecomment-1169210337 The torch lib with bitcode enable.
  31. # ss.ios.vendored_libraries = 'Torch/lib/*.a'
  32. # ss.resources = 'Torch'
  33. # ss.xcconfig = {
  34. # 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}/Torch/include" "${PODS_TARGET_SRCROOT}/TorchLite/include/torch/csrc/api/include"',
  35. # 'GCC_PREPROCESSOR_DEFINITIONS' => 'IOS_METAL=1'
  36. # }
  37. ## https://github.com/CocoaPods/CocoaPods/issues/10104#issuecomment-701212173 only for arm64 arch.
  38. # ss.pod_target_xcconfig = {
  39. # 'VALID_ARCHS' => 'arm64',
  40. # 'OTHER_LDFLAGS' => '$(inherited) -Objc -all_load', # The linker has a bug that does not load static lib
  41. # 'ENABLE_BITCODE' => 'NO'
  42. # }
  43. # ss.frameworks = 'Accelerate', 'MetalPerformanceShaders', 'CoreML'
  44. # end
  45. # s.subspec 'TorchLite' do |ss|
  46. ## https://medium.com/@khaifunglim97/how-to-build-a-flutter-app-with-c-c-libraries-via-ffi-on-android-and-ios-including-opencv-1e2124e85019
  47. ## Fixed the issue that does not find the headers when use_framework is enabled in above link.
  48. ## https://github.com/pytorch/pytorch/issues/49406#issuecomment-1169210337 The torch lib with bitcode enable.
  49. # ss.ios.vendored_libraries = 'TorchLite/lib/*.a'
  50. # ss.resources = 'TorchLite'
  51. # ss.xcconfig = {
  52. # 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}/TorchLite/include" "${PODS_TARGET_SRCROOT}/TorchLite/include/torch/csrc/api/include"'
  53. # }
  54. ## https://github.com/CocoaPods/CocoaPods/issues/10104#issuecomment-701212173 only for arm64 arch.
  55. # ss.pod_target_xcconfig = {
  56. # 'OTHER_LDFLAGS' => '-all_load' # The linker has a bug that does not load static lib
  57. # }
  58. # end
  59. s.libraries = ['c++', 'stdc++']
  60. s.ios.vendored_frameworks = "opencv2.framework"
  61. # tflite debug
  62. # s.subspec 'tflite_debug' do |ss|
  63. # ss.ios.vendored_frameworks = "tflite_framework_debug/TensorFlowLiteC.framework", "tflite_framework_debug/TensorFlowLiteCMetal.framework"
  64. # ss.xcconfig = {
  65. # 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}/tflite_framework_debug/TensorFlowLiteC.framework/Headers" "${PODS_TARGET_SRCROOT}/tflite_framework_debug/TensorFlowLiteCMetal.framework/Headers"'
  66. # }
  67. # end
  68. s.xcconfig = {
  69. 'HEADER_SEARCH_PATHS' => '$(inherited) "${PODS_TARGET_SRCROOT}/cross_plat_cpp"'
  70. }
  71. s.subspec 'tflite_release' do |ss|
  72. ss.ios.vendored_frameworks = "tflite_framework_release/TensorFlowLiteC.framework", "tflite_framework_release/TensorFlowLiteCMetal.framework"
  73. ss.xcconfig = {
  74. 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}/tflite_framework_release/TensorFlowLiteC.framework/Headers" "${PODS_TARGET_SRCROOT}/tflite_framework_release/TensorFlowLiteCMetal.framework/Headers"'
  75. }
  76. end
  77. end