Issue
I'm building a fat APK that contains separate *.so libs for armeabi
and armeabi-v7a
. I build using the command line only (i.e. using ndk-build
and ant
). Is there a way to detect from my C code whether the ndk-build
is currently building for armeabi
or for armeabi-v7a
? Preferably, I would like to be able to detect this at compile time, but if there is no other choice an architecture detection at runtime would also be sufficient.
E.g. is there something like
#ifdef __armeabiv7a__
...
#else
...
#endif
to detect the architecture at compile time?
I know that I can pass additional compiler flags in LOCAL_CFLAGS
in Android.mk
but these flags are always passed for all architectures so it doesn't help me. Or is there a tag that I could use in Android.mk
to pass specific flags for armeabi
or armeabi-v7a
only?
Solution
I know that I can pass additional compiler flags in
LOCAL_CFLAGS
in Android.mk but these flags are always passed for all architectures
There's nothing preventing you from setting a flag only when building for a certain ABI:
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_CFLAGS += -DARMEABI_V7A
endif
Answered By - Michael
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.