由于我有一个处理密集型应用程序,我想构建一个支持NEON / Advanced SIMD的变体。另外我有多个带有算法的源文件,所以我不想分别为每个文件启用霓虹灯。以下是重要部分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)
我尝试为ARMv7a构建 2 个库,但遗憾的是,由于使用了“高级”Makefile 工具,我无法编译 2 个不同的库。
它覆盖了.o
目标:
/android-ndk/build/core/build-binary.mk:272: warning: overriding commands for target `obj/local/armeabi-v7a/objs/myalg.o'
可悲的是,我还没有找到一种方法来强制构建霓虹灯对象objs-neon
而不是obj
.
有什么办法可以优雅地解决这个问题吗?