Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift Package Manager [WIP] #4

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from
Draft

Swift Package Manager [WIP] #4

wants to merge 33 commits into from

Conversation

chrisballinger
Copy link

@chrisballinger chrisballinger commented Nov 17, 2020

Testing notes:

  • cd /path/to/opencv
  • First build the xcframework python platforms/apple/build_xcframework.py platforms/apple/xcframework-build/ or place your prebuilt opencv2.xcframework at platforms/apple/xcframework-build/opencv2.xcframework
  • swift build

Currently dealing with some interface issues with the existing Swift module from the objc module:

/Users/chrisbal/Documents/opencv/.build/x86_64-apple-macosx/debug/opencv2.framework/Modules/opencv2.swiftmodule/x86_64-apple-macos.swiftinterface:676:81: error: ambiguous type name 'Rect' in module 'opencv2'
  public func detectMultiScale(img: opencv2.Mat, foundLocations: inout [opencv2.Rect], foundWeights: inout [Swift.Double], hitThreshold: Swift.Double)
                                                                        ~~~~~~~ ^
opencv2.Rect:1:12: note: found candidate with type 'Rect'
open class Rect : NSObject {
           ^
Darwin.Rect:1:15: note: found candidate with type 'Rect'
public struct Rect {
              ^

I think one possible solution could be to remove the Swift stuff from the objc module and only include it via the Swift Package, but it would be a breaking change for consumers of the existing module.

TODO:

  • Fix swift module interface so it compiles
  • Get tests in modules/core/misc/objc/test to run via swift test

Resolves opencv#18398

@colejd
Copy link

colejd commented Nov 17, 2020

Related: opencv#18843

@colejd colejd force-pushed the feature/colejd/build-catalyst-xcframework branch from 369bc7d to 476fc39 Compare November 20, 2020 17:26
@colejd colejd force-pushed the swift-package branch 3 times, most recently from 5a55be0 to b949a72 Compare November 20, 2020 23:01
@chrisballinger chrisballinger force-pushed the swift-package branch 3 times, most recently from 7963e82 to be919ae Compare November 23, 2020 22:19
@chrisballinger chrisballinger changed the base branch from feature/colejd/build-catalyst-xcframework to master November 25, 2020 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants