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

Adding required system libs to Package.swift file #64

Open
robgtsoftware opened this issue Jan 8, 2021 · 3 comments
Open

Adding required system libs to Package.swift file #64

robgtsoftware opened this issue Jan 8, 2021 · 3 comments

Comments

@robgtsoftware
Copy link

SDK 1.10

In the install instructions for SPM, you indicate that a list of system libs are required for installation, e.g. Security, etc. I was curious if you could add them to the definition for the swift package and found what I think is the correct syntax (see below), but have not found a way to test as setting up a simple project with the BugfenderSDK package and not adding those libs to the list to link against does not cause any problems in building or running the app. So a few questions:

  1. Are those libs really required and if so, how are they used.
  2. Do you think something like the following is a good idea to add (assuming it works as desired)?
targets: [
        .binaryTarget(
            name: "BugfenderSDK",
            url: "https://github.com/bugfender/BugfenderSDK-iOS/releases/download/1.10.0/BugfenderSDK.xcframework.zip",
            checksum: "3fd533eac972d4eae42da0169918f349f90f15dd6d6847aa12308e40768f9fee"
        ),
        .target(
            name: "SystemLibs", 
            linkerSettings: [
                .linkedFramework("SystemConfiguration"),
                .linkedFramework("Security"),
                .linkedFramework("MobileCoreServices"), 
                .linkedFramework("CoreGraphics"), 
                .linkedLibrary("libc++")
                ]
        ),
    ]
@jgimenez
Copy link
Member

Hi @robgtsoftware, those frameworks are indeed needed, although at the moment I can't tell why each one is needed. Thanks for your suggestion, our team will look into it

@jgimenez
Copy link
Member

Looks like this is not possible without a hack at the moment: https://bugs.swift.org/browse/SR-14245

I guess your proposed solution should also work, although users would need to explicitly select to import both targets, which is kind of hacky as well. Not sure if just manually adding the dependencies is better or worse.

@robgtsoftware
Copy link
Author

Thanks for the followup. This is a nice to have, but definitely not essential, especially if the solutions are hacks. Hopefully, something for the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants