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

Distributing generated xcframeworks #109

Open
tcollins590 opened this issue Nov 15, 2023 · 1 comment
Open

Distributing generated xcframeworks #109

tcollins590 opened this issue Nov 15, 2023 · 1 comment

Comments

@tcollins590
Copy link

I've successfully used scipio to generate the xcframework for my package. It's also generated an xcframework for each of the 5 dependencies I have in my project.

My questions are:

  1. Are the dependencies baked into my main target's xcframework? Or do all of the dependency xcframeworks need to be imported into a consuming project?
  2. Best way to distribute my package? Shall I create another package which will be a public repo that imports my xcframework as a binary? Do I also need to import each generated xcframework as a binary target, or since these are all third party, would adding them as a regular package dependency work?

Appreciate any guidance. Once I understand this a bit better I'm happy to help out on docs to improve examples.

@giginet
Copy link
Owner

giginet commented Nov 22, 2023

@tcollins590
Sorry for waiting for you.

Q1.

No. Each XCFramework has symbols for each target. These are not combined. So you need to link to all dependent XCFrameworks.

Q2.

Do you mean you want to distribute XCFramework built with Scipio?

If you can publish the source code, I recommend distributing it as a regular Swift package and leaving the integration method to the user.

If you want to publish it as a prebuilt binary, it's better to publish as a binary package.
Prepare your XCFramework and publish it with binaryTarget in Package.swift
https://developer.apple.com/documentation/xcode/distributing-binary-frameworks-as-swift-packages

At this time, consider Library Evolution when preparing XCFramework with Scipio.

As we said in the documentation, LE is disabled by default in Scipio, making it unable to keep ABI compatibility.
You can build it in a suitable format for distribution by passing the -enable-library-evolution option.
https://giginet.github.io/Scipio/documentation/scipio/create-frameworks#Enable-Library-Evolution

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

No branches or pull requests

2 participants