-
Notifications
You must be signed in to change notification settings - Fork 114
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
Dynamic linking for SPM #266
base: master
Are you sure you want to change the base?
Conversation
Added `.dynamic` in the products definition to make sure the SPM bundle is dynamically linked.
See #265 for more information about the rational behind this PR. |
How about we keep |
This option allows us to keep both the statically and dynamically linked libraries. The "default" one will be (`ReactiveKit`) *should* be statically linked -- unless SPM can, in the future, manage to automatically decide what the best scenario is -- and `ReactiveKitDynamic` will be dynamically linked (always).
Sure thing. See the new commit. We could explicitly declare ReactiveKit as |
All 3 options could be offered :
|
Do you think it would make sense to offer all three options? We could do that. |
The only reason I can think of is if we'd want more control down the road when Xcode can "magically" decide how to link those libraries inside frameworks and it doesn't really work as intended or there's no option to "force" one behavior or the other. |
Forward thinking, sounds good to me :) Let's do all three options then. I'll release a new versions when you have the updated PR. |
FYI. Still working through the kinks... Adding 2 libraries seem to be creating some issues. Trying to fix that. |
Ok, after several tests, it seems that the main issue would be wrt Bond's dependencies. So for example, if we implement the following strategy for Bond :
Then the dependencies, for the target, point to :
There's a way to impose conditions on target dependencies, but it's limited to platforms at the moment. I am just not sure if it matters, and if we can just use RK's dynamically-linked library and let SPM decide how it's gonna work when Bond is imported into an app. |
We now have both explicitly declared a statically and dynamically linked library, in addition to the "undefined" RK library.
@srdanrasic : Here's the Bond Package.swift that I used to validate the changes (compiles and doesn't crash as long as both ReactiveKitDynamic and BondDynamic are used for the dependencies). https://github.com/npvisual/Bond/blob/fix/spm-dynamic/Package.swift |
Added
.dynamic
in the products definition to make sure the SPM bundle is dynamically linked.