简体   繁体   中英

Build android arm64 native library using qmake

I'm using qmake for generating make files for my native library (just generate make files, no usage of Qt libs).

There are only android armv5, armv7 and x86 supported by qt, so when I build my library using qmake from any qt package above I can build only armv5, armv7 and x86 libraries.

Is there a way to specify another target architecture for qmake (arm64 of mips for example)?

you need to build the arm64-v8a library yourself,

and use your arm64-v8a qmake to build your own library.

this is mac build version

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

you also can download arm64-v8a library here: https://github.com/LightZam/Qt-Library

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM