-
Notifications
You must be signed in to change notification settings - Fork 35
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
Introduce Mergeable Library Support #127
Changes from 6 commits
0af8bde
687339f
3df7f7d
bdfe916
9606352
f964649
1b59af9
0565b50
cf373db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Support Mergeable Library | ||
|
||
Apple announced [Mergeable Library](https://developer.apple.com/documentation/xcode/configuring-your-project-to-use-mergeable-libraries) in WWDC23. Mergeable Library is the new framework type which can switch the linking style by the build configuration. It has the metadata to change the linking style on the link time. | ||
|
||
Scipio supports `mergeable` framework type to distribute packages as mergeable libraries. | ||
|
||
```shell | ||
$ scipio create path/to/MyPackage --framework-type mergeable --enable-library-evolution | ||
``` | ||
|
||
See details the official documentation and following WWDC session. | ||
|
||
- [Configuring your project to use mergeable libraries | Apple Developer Documentation](https://developer.apple.com/documentation/xcode/configuring-your-project-to-use-mergeable-libraries) | ||
- [Meet mergeable libraries - WWDC23 - Videos - Apple Developer](https://developer.apple.com/videos/play/wwdc2023/10268/) | ||
|
||
In general, mergeable frameworks will be about 2x bigger binary size than the normal dynamic frameworks. | ||
|
||
## How to check whether the built framework is mergeable or not | ||
|
||
Mergeable frameworks have `LC_ATOM_INFO` load command in the binary. You can check it by `otool` command. | ||
|
||
```shell | ||
echo $(otool -l path/to/binary) | grep "LC_ATOM_INFO" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Q. |
||
``` | ||
|
||
## Limitation | ||
|
||
Some frameworks can't build as a dynamic framework by some reasons. They can't be distributed as mergeable libraries. Try `--framework-type static` instead. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,16 +86,16 @@ All XCFrameworks are generated into `MyAppDependencies/XCFramework` by default. | |
|
||
`prepare` command has some options. These are available options. | ||
|
||
|Flag|Description|Default| | ||
|---------|------------|-----------| | ||
|-\-configuration, -c|Build configuration for generated frameworks (debug / release)|release| | ||
|-\-output, -o|Path indicates a XCFrameworks output directory|$PACKAGE_ROOT/XCFrameworks| | ||
|-\-embed-debug-symbols|Whether embed debug symbols to frameworks or not|-| | ||
|-\-static|Whether generated frameworks are Static Frameworks or not|-| | ||
|-\-support-simulators|Whether also building for simulators of each SDKs or not|-| | ||
|-\-cache-policy|How to reuse built frameworks|project| | ||
|-\-enable-library-evolution|Whether to enable Library Evolution feature or not|-| | ||
|-\-only-use-versions-from-resolved-file|Whether to disable updating Package.resolved automatically|false| | ||
| Flag | Description | Default | | ||
|-----------------------------------------|---------------------------------------------------------------------|----------------------------| | ||
| -\-configuration, -c | Build configuration for generated frameworks (debug / release) | release | | ||
| -\-output, -o | Path indicates a XCFrameworks output directory | $PACKAGE_ROOT/XCFrameworks | | ||
| -\-embed-debug-symbols | Whether embed debug symbols to frameworks or not | - | | ||
| -\-framework-type | Framework type to generate Available: dynamic, static or mergeable) | dynamic | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Q. Default is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, third column is the default value |
||
| -\-support-simulators | Whether also building for simulators of each SDKs or not | - | | ||
| -\-cache-policy | How to reuse built frameworks | project | | ||
| -\-enable-library-evolution | Whether to enable Library Evolution feature or not | - | | ||
| -\-only-use-versions-from-resolved-file | Whether to disable updating Package.resolved automatically | false | | ||
|
||
|
||
See `--help` for details. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thank you for the links