Conditional compile for armeabi-v7a

129 views
Skip to first unread message

RLScott

unread,
Dec 17, 2013, 10:19:14 AM12/17/13
to andro...@googlegroups.com
My Application.mk includes:

  APP_ABI := armeabi armeabi-v7a

So it builds two libraries, one for ARMEABI and the other for ARMEABI-v7a.  In my C code I would like to use #if or #ifdef to do something different, depending on which option is in effect.  Can anyone tell me what the symbol is that I can query like this to tell me which version is being compiled?

David Turner

unread,
Dec 18, 2013, 5:30:07 AM12/18/13
to andro...@googlegroups.com
__ARM_ARCH_7A__ is defined by the compiler when targetting armeabi-v7a, that should be enough to do what you need in a #ifdef ... #else ... #endif block.

Hope this helps.



--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/groups/opt_out.

Luca Castoro

unread,
Dec 30, 2013, 12:08:20 AM12/30/13
to andro...@googlegroups.com
Also, you can put

LOCAL_CFLAGS += -DABI="$(TARGET_ARCH_ABI)"

or even

LOCAL_CFLAGS += -DABI="\"$(TARGET_ARCH_ABI)\""

in your .mk and then the ABI macro will contain the current abi, in the latter case, as a string.

Reply all
Reply to author
Forward
0 new messages