BugfenderSDK-iOS icon indicating copy to clipboard operation
BugfenderSDK-iOS copied to clipboard

Adding required system libs to Package.swift file

Open robgtsoftware opened this issue 5 years ago • 3 comments

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++")
                ]
        ),
    ]

robgtsoftware avatar Jan 08 '21 12:01 robgtsoftware

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 avatar Jan 11 '21 14:01 jgimenez

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.

jgimenez avatar Mar 25 '21 00:03 jgimenez

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.

robgtsoftware avatar Mar 26 '21 16:03 robgtsoftware