Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conditional compiling for armv6 and armv7

I have a published application which supports both amrv6 and armv7. Now I have an upgrade which is only compliant with armv7 (I added an external library which depends on armv7). When I try to submit the app to the store it I get the error detailed in

I understand the previous error and I need to change my app so it supports both architectures. My problem is that my code depends on a library which is only compliant with armv7. If I change the properties of my project to support both armv6 and armv7 I get a compilation error (details below). I need to be able to compile the code with support for both architectures: armv7 compiles using the library I depend on armv6 has a different code which does not depend on the library.

How can I achieve this?

Error details:

• the compile crash is in one Lib file (.a) and the error says : ld: warning: directory not found for option '-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/gcc/arm-apple-darwin10/4.0.1' ld: in /Users/.../(lib file).a, file is universal but does not contain a(n) armv6 slice for architecture armv6 Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

Thanks in advance

like image 823
silvaric Avatar asked Mar 07 '12 12:03

silvaric


2 Answers

I received this answer from Apple:

You cannot conditionally build your app for either armv6 or armv7. Your static library must be built for both armv6 and armv7 since your application supports both of these architectures...You can drop support for armv6 by setting your iOS deployment target to 4.3 or higher.

Basically i need to ask the developer of the library to build for both of there architectures ( =/ ) or i set my minimum target to 4.3 and only armv7

like image 131
silvaric Avatar answered Nov 17 '22 15:11

silvaric


In your build settings, if you hover over a setting, a + appears that you can click on to scope a setting to a particular architecture. You'll have to remove the library from the normal list of libraries and add it in by passing the -L argument manually only for armv7. You'll probably also have to add in a preprocessor definition so you can put #ifdefs around the code that calls the library.

Edit: Thinking about it, you might be able to do it in a simpler way by marking the library as optional in the build phases section.

like image 26
Jim Avatar answered Nov 17 '22 15:11

Jim