diff --git a/mediapipe/swift/solutions/lindera/BUILD b/mediapipe/swift/solutions/lindera/BUILD index 42c4f0851..01c01a50b 100644 --- a/mediapipe/swift/solutions/lindera/BUILD +++ b/mediapipe/swift/solutions/lindera/BUILD @@ -1,8 +1,45 @@ load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") +load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application", "ios_framework", "ios_static_framework", "ios_unit_test") + +genrule( + name = "podgen", + srcs = [ + "lindera-framework", + "LinderaDetection.podspec", + ], + outs = ["LinderaDetection.zip"], + cmd = """ + mkdir mediapipe/swift/solutions/lindera/frameworks + unzip $(location lindera-framework) -d mediapipe/swift/solutions/lindera/frameworks + cd mediapipe/swift/solutions/lindera/ + + zip -r LinderaDetection.zip frameworks LinderaDetection.podspec + cd ../../../../ + cp mediapipe/swift/solutions/lindera/LinderaDetection.zip $@ + """, +) + +# bazel build //mediapipe/swift/solutions/lindera:lindera-framework -c opt --config=ios_fat --cxxopt=--std=c++17 --copt=-fembed-bitcode --linkopt="-s" +ios_static_framework( + name = "lindera-framework", + # hdrs = EDGE_ENGINE_HDRS, + bundle_name = "LinderaDetection", + minimum_os_version = "12.0", + visibility = ["//visibility:public"], + deps = [ + ":lindera", + # "//third_party:opencv", + # "@ios_opencv//:OpencvFramework", + ], +) swift_library( name = "lindera", - srcs = ["Lindera.swift","Asensei3D.swift","utils.swift"], + srcs = [ + "Asensei3D.swift", + "Lindera.swift", + "utils.swift", + ], linkopts = [ "-lc++", "-std=c++17", diff --git a/mediapipe/swift/solutions/lindera/LinderaDetection.podspec b/mediapipe/swift/solutions/lindera/LinderaDetection.podspec new file mode 100644 index 000000000..50f6c415a --- /dev/null +++ b/mediapipe/swift/solutions/lindera/LinderaDetection.podspec @@ -0,0 +1,141 @@ +# +# Be sure to run `pod spec lint EdgeEngine.podspec' to ensure this is a +# valid spec and to remove all comments including this before submitting the spec. +# +# To learn more about Podspec attributes see https://guides.cocoapods.org/syntax/podspec.html +# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ +# + +Pod::Spec.new do |spec| + + # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # These will help people to find your library, and whilst it + # can feel like a chore to fill in it's definitely to your advantage. The + # summary should be tweet-length, and the description more in depth. + # + + spec.name = "LinderaDetection" + spec.version = "0.0.1" + spec.summary = "LinderaDetection is a simple yet powerful interface to run AI Health Solutions" + + # This description is used to generate tags and improve search results. + # * Think: What does it do? Why did you write it? What is the focus? + # * Try to keep it short, snappy and to the point. + # * Write the description between the DESC delimiters below. + # * Finally, don't worry about the indent, CocoaPods strips it! + spec.description = "LinderaDetection is a simple yet powerful interface to run AI Health Solutions" + + spec.homepage = "https://github.com/udamaster/mediapipe" + # spec.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" + + + # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Licensing your code is important. See https://choosealicense.com for more info. + # CocoaPods will detect a license file if there is a named LICENSE* + # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. + # + + spec.license = "MIT (example)" + spec.license = { :type => "MIT"} + + + # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Specify the authors of the library, with email addresses. Email addresses + # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also + # accepts just a name if you'd rather not provide an email address. + # + # Specify a social_media_url where others can refer to, for example a twitter + # profile URL. + # + + spec.author = "Copper Labs" + + + # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # If this Pod runs only on iOS or OS X, then specify the platform and + # the deployment target. You can optionally include the target after the platform. + # + + # spec.platform = :ios + spec.platform = :ios, "12.0" + + # When using multiple platforms + # spec.ios.deployment_target = "5.0" + # spec.osx.deployment_target = "10.7" + # spec.watchos.deployment_target = "2.0" + # spec.tvos.deployment_target = "9.0" + + + # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Specify the location from where the source should be retrieved. + # Supports git, hg, bzr, svn and HTTP. + # + + spec.source = { :http => 'https://edge-engine-store.s3.amazonaws.com/libs/ios/EdgeEngine/pod/EdgeEngine.zip' } + + # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # CocoaPods is smart about how it includes source code. For source files + # giving a folder will include any swift, h, m, mm, c & cpp files. + # For header files it will include any header in the folder. + # Not including the public_header_files will make all headers public. + # + + # spec.source_files = "" + # spec.exclude_files = "Classes/Exclude" + + # spec.public_header_files = "" + + + # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # A list of resources included with the Pod. These are copied into the + # target bundle with a build phase script. Anything else will be cleaned. + # You can preserve files from being cleaned, please don't preserve + # non-essential files like tests, examples and documentation. + # + + # spec.resource = "icon.png" + # spec.resources = "Resources/*.png" + + # spec.preserve_paths = "FilesToSave", "MoreFilesToSave" + + + # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Link your library with frameworks, or libraries. Libraries do not include + # the lib prefix of their name. + # + + # spec.framework = "SomeFramework" + # spec.frameworks = "SomeFramework", "AnotherFramework" + + # spec.library = "iconv" + # spec.libraries = "iconv", "xml2" + + + # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # If your library depends on compiler flags you can set them in the xcconfig hash + # where they will only apply to your library. If you depend on other Podspecs + # you can include multiple dependencies to ensure it works. + + # spec.requires_arc = true + + # spec.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } +# spec.dependency "OpenCV", "~> 3.4" + spec.static_framework = true + + spec.ios.vendored_frameworks = 'frameworks/*.framework' + # spec.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-lc++' } + # spec.user_target_xcconfig = {'OTHER_LDFLAGS' => '-lc++' } + spec.libraries = 'stdc++' + # ――― Temporary Architecture fixes + spec.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } + spec.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } +end