Carthage: Embedded Binaries vs Linked Frameworks and Libraries

Created on 17 Jan 2016  Â·  5Comments  Â·  Source: Carthage/Carthage

Actually I have a more general question here http://stackoverflow.com/questions/34834717/what-are-the-libraries-linking-options-in-xcode

In the README, Carthage seems to differentiate between iOS and OS X. Specifically, it is about Embedded Binaries vs Linked Frameworks and Libraries

If you're building for OS X: On your application targets’ “General” settings tab, in the “Embedded Binaries” section, drag and drop each framework you want to use from the Carthage/Build folder on disk.

If you're building for iOS, tvOS, or watchOS: On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop each framework you want to use from the Carthage/Build folder on disk.

The Adding frameworks to unit tests or a framework section seems to reveal more about that

Because non-application targets are missing the “Embedded Binaries” section in their build settings, you must instead drag the built frameworks to the “Link Binaries With Libraries” build phase.

Sorry that I don't know much about OS X, but what are the difference between those?

question

Most helpful comment

Embedding binaries copies the entire framework to the target.
for building for ios/tvOS/watchOS apple has been strict in not allowing that the frameworks bundled are "fat" (that means that the libraries are built for multiple architectures: arm+i386+x86_64 for example) for keeping the binary sizes low.
that is why you should only link the frameworks but not embed them in ios, instead you add a run script phase that copies the framework stripping the data that does not belong to the target

All 5 comments

but what are the difference between those?

I'm not sure TBH.

Embedding binaries copies the entire framework to the target.
for building for ios/tvOS/watchOS apple has been strict in not allowing that the frameworks bundled are "fat" (that means that the libraries are built for multiple architectures: arm+i386+x86_64 for example) for keeping the binary sizes low.
that is why you should only link the frameworks but not embed them in ios, instead you add a run script phase that copies the framework stripping the data that does not belong to the target

Thanks for your answer @BoteRock! Closing this.

good to know :D, but we can _add_ Linked Frameworks and Libraries and _add_ Embedded Binaries with framworks or libraries that we add before from Linked Frameworks and Libraries ...is that good @BoteRock ?

Is there a way to Embed Binaries into a Carthage framework.?

Was this page helpful?
0 / 5 - 0 ratings