Skip to content Skip to sidebar Skip to footer

Android Ndk : Compiling Different Libraries For Different Architectures

I have a small c++ library that must be compiled for both armeabi and armeabi7a. I also have a very large c++ library that only needs to be compiled for armeabi. Right now they a

Solution 1:

It is definitely possible. There are some code snippets to get you going (without exact content of Android.mk for biglib and smallib I can't help you more).

1) Change order of APP_ABI to APP_ABI := armeabi armeabi-v7a in Application.mk.

2) Modify your root Android.mk:

LOCAL_PATH := $(call my-dir)
LOCAL_C_INCLUDE := $(LOCAL_PATH)/include# biglib is not built for armeabi-v7aifneq"$(TARGET_ARCH_ABI)""armeabi-v7a"include$(LOCAL_PATH)/biglib/Android.mk
endif# ----- cut here -----# Place this snippet to every module which needs biglib, or where convenient.# Now you will link against armeabi version of biglib.ifeq"$(TARGET_ARCH_ABI)""armeabi-v7a"
  LOCAL_LDFLAGS += $(LOCAL_PATH)/../obj/local/armeabi/libbigLib.so
endif# ----- cut here -----include$(LOCAL_PATH)/smalllib/Android.mk

And thats all - your apk file now doesn't contain libbiglib.so for armeabi-v7a

Post a Comment for "Android Ndk : Compiling Different Libraries For Different Architectures"