Android ndk-build 忽略 APP_ABI := x86 [英] Android ndk-build ignoring APP_ABI := x86
问题描述
我正在尝试运行 NDK 来编译本机代码以在 Atom(x86) 处理器和 ARM 上运行.无论我如何设置 APP_ABI,NDK 都在生成 armeabi 库.即使我只为 APP_ABI 放置 x86.并且文件大小始终相同.这是我的 Application.mk 文件:
I'm trying to run NDK to compile native code to run on Atom(x86) processor as well as ARM. No matter how I set APP_ABI, NDK is generating armeabi library. Even if I put only x86 for APP_ABI. And the file size is always the same. here is my Application.mk file:
LOCAL_PATH := $(call my-dir)
APP_ABI := x86
include $(CLEAR_VARS)
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog
LOCAL_MODULE := myjni-jni
LOCAL_SRC_FILES := myjni-jni.c
include $(BUILD_SHARED_LIBRARY)
无论我在 APP_ABI 之后放了什么,我都会得到 armeabi 并且它的大小始终相同.这里有什么问题?我正在使用最新的 NDK.
No Matter what I put after APP_ABI I am getting armeabi and its always same size. Whats wrong here? I am using latest NDK.
推荐答案
你应该把 APP_ABI 变量放在 Application.mk 文件而不是 Android.mk 文件中.
You should put APP_ABI variable in Application.mk file not Android.mk file.
它写在 NDK 的文档中(docs/CPU-ARCH-ABIS.html 文件).
It's written in documentation of NDK (docs/CPU-ARCH-ABIS.html file).
这篇关于Android ndk-build 忽略 APP_ABI := x86的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!