Re: Any supported way to build a static lib with both ARM and x86 (simulator) binaries?
Re: Any supported way to build a static lib with both ARM and x86 (simulator) binaries?
- Subject: Re: Any supported way to build a static lib with both ARM and x86 (simulator) binaries?
- From: Chris Hanson <email@hidden>
- Date: Sat, 19 Jul 2014 10:51:46 -0700
On Jul 16, 2014, at 11:32 AM, Jens Alfke <email@hidden> wrote:
My work project’s[1] deliverable is an iOS static library for developers to build into their apps. So that they can build their apps for both the simulator and real devices, this library needs to contain both ARM binaries and x86 binaries.
Cross-platform binaries like this aren’t actually supported. (iOS and the iOS Simulator are considered distinct platforms.) Multi-architecture binaries are only supported within a platform.
Unfortunately, there isn’t any supported way I know of to build such a library in Xcode, at least not without manual intervention or using a command-line-based build process instead of the GUI.
This is because cross-platform binaries aren’t actually supported.
You can have platform binaries in different directories derived from the platform name (macosx, iphoneos, iphonesimulator), and have developers add a $(PLATFORM_NAME) component to the Library Search Paths that point to your stuff:
FRAMEWORK_SEARCH_PATHS = JensKit/$(PLATFORM_NAME) $(inherited) where the libraries are in JensKit/iphoneos/libjenskit.a and JensKit/iphonesimulator/libjenskit.a and so on, and the right one will be found at build time. (By default frameworks and libraries specified in the IDE are passed by name to the compiler and linker, not by path. To pass an explicit path you need to add that path to OTHER_LDFLAGS, which in most cases shouldn’t be necessary.)
-- Chris
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden