Since I have a very processing intensive App I would like to build a variant with NEON / Advanced SIMD support. Also I have multiple source files with algorithms, so I don't want to enable neon for every file separately.
Following the important part of the Android.mk
:
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
include $(CLEAR_VARS)
# Build Advanced SIMD variant
LOCAL_MODULE := mymod-neon
LOCAL_ARM_NEON := true
LOCAL_ARM_MODE := $(MY_ARM_MODE)
LOCAL_SRC_FILES := $(MY_SRC_FILES)
LOCAL_C_INCLUDES := $(MY_C_INCLUDES)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_SHARED_LIBRARIES := $(MY_SHARED_LIBRARIES)
include $(BUILD_SHARED_LIBRARY)
endif
include $(CLEAR_VARS)
# Build regular variant
LOCAL_MODULE := mymod
LOCAL_ARM_MODE := $(MY_ARM_MODE)
LOCAL_SRC_FILES := $(MY_SRC_FILES)
LOCAL_C_INCLUDES := $(MY_C_INCLUDES)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_SHARED_LIBRARIES := $(MY_SHARED_LIBRARIES)
include $(BUILD_SHARED_LIBRARY)
I tried to build 2 libraries for ARMv7a, but sadly since using the "advanced" Makefile tool, it doesn't get that I am compiling 2 different libraries.
It overrides the .o
target:
/android-ndk/build/core/build-binary.mk:272: warning: overriding commands for target `obj/local/armeabi-v7a/objs/myalg.o'
Sadly I have not found a way to force the neon objects being built in objs-neon
instead of obj
.
Is there any way one can resolve this in an elegant matter?