【问题标题】:Build android arm64 native library using qmake使用 qmake 构建 android arm64 本机库
【发布时间】:2015-08-18 15:17:19
【问题描述】:
我正在使用 qmake 为我的本地库生成 make 文件(只生成 make 文件,不使用 Qt 库)。
qt 只支持 android armv5、armv7 和 x86,所以当我使用上面任何 qt 包中的 qmake 构建我的库时,我只能构建 armv5、armv7 和 x86 库。
有没有办法为 qmake 指定另一个目标架构(例如 arm64 of mips)?
【问题讨论】:
标签:
android
c++
qt
android-ndk
qmake
【解决方案1】:
你需要自己构建arm64-v8a库,
并使用您的 arm64-v8a qmake 构建您自己的库。
这是mac构建版本
git clone git://code.qt.io/qt/qt5.git qt5
cd qt5
perl init-repository
./configure \
-confirm-license \
-opensource \
-xplatform android-g++ \
-nomake tests \
-nomake examples \
-android-ndk /usr/local/Cellar/android-ndk/r10e \
-android-sdk ~/Documents/android-sdk-macosx \
-android-ndk-host darwin-x86_64 \
-android-toolchain-version 4.9 \
-android-arch arm64-v8a \
-android-ndk-platform android-21 \
-skip qtdeclarative \
-skip qttranslations \
-skip qtserialport \
-no-warnings-are-errors \
-no-compile-examples \
-no-sql-mysql \
-no-sql-psql \
-prefix ~/Documents/Qt/android_arm64-v8a \
-prefix-install \
-openssl \
-I /usr/local/Cellar/openssl/1.0.2k/include -L /usr/local/Cellar/openssl/1.0.2k/lib
make -j4
make -j4 install
你也可以在这里下载 arm64-v8a 库:https://github.com/LightZam/Qt-Library