Any supported way to build a static lib with both ARM and x86 (simulator) binaries?
Any supported way to build a static lib with both ARM and x86 (simulator) binaries?
- Subject: Any supported way to build a static lib with both ARM and x86 (simulator) binaries?
- From: Jens Alfke <email@hidden>
- Date: Wed, 16 Jul 2014 11:32:50 -0700
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.
This seems like a pretty reasonable and not-uncommon situation. 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. The reason is that Xcode builds only ARM or only x86 binaries, depending on the state of the scheme destination pop-up in the GUI. So to build a fat library you have to build once, manually switch the setting of the pop-up, build again, and then run lipo to combine the two libraries.
Now, there are ugly workarounds[2] for this. They involve a custom script build phase that invokes xcodebuild to build the other flavor. The script was written by someone else and I don’t entirely understand it. It sometimes breaks with new versions of Xcode, sometimes just randomly screws up for reasons I don’t understand until I trash the build directory, and I would dearly love to get rid of it.
(This has been a thorn in my side for literally three years, and my hacks date from the Xcode 3 era so I’m checking whether there’s a newer supported solution that I might have overlooked. Yes, I have filed a Radar about this, back in 2011, and never heard anything back at all.)
—Jens
[1]: http://www.couchbase.com/mobile#lite
[2]: http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
_______________________________________________
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