Two .a files (one for device other for simulator)
I was given an SDK which I need to integrate into an iPhone app. I was given 2 .a files, one for simulator and one for the device. Right now, I have to constantly swap these files depending on the testing destination (device or simulator). Is there a way I can make it so Xcode automatically configures the right .a file depending 开发者_如何学JAVAon where I want to test it? Thanks.
Oh btw, I am using Xcode 4. Thanks!
I would try and build a fat, i386/arm version of the library by using lipo.
You can use this command:
lipo -create liblib-i386.a liblib-arm.a -output liblib-fat.a
The linker will be able to extract just the symbols it needs from it according to the platform.
You can use lipo to create a "fat binary" that contains both architectures.
lipo -create binary1.a binary2.a -output fatbinary.a
You can also create two targets and use the appropriate lib file.
精彩评论