summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2020-12-02 12:10:20 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2020-12-02 12:10:20 +0800
commit3de85672c4c5185a0568d6447f86a7ce149752f1 (patch)
tree342f8630020093cf8c8751ef7cf4ecae1a5d4481
parent0f4aa1c3c7a25fe7e68f7e253eac818e261360f0 (diff)
Use dynamic variables for project file
-rw-r--r--README.md2
-rw-r--r--kelakon.pro68
2 files changed, 18 insertions, 52 deletions
diff --git a/README.md b/README.md
index 2cd125e..513679a 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,7 @@ or
```sh
$ mkdir build-kelakon-Android_Qt_5_15_1_Clang_Multi_Abi-Debug
$ cd build-kelakon-Android_Qt_5_15_1_Clang_Multi_Abi-Debug
-$ /opt/Qt/5.15.1/android/bin/qmake ../kelakon/kelakon.pro -spec android-clang CONFIG+='debug qml_debug' ANDROID_ABIS="armeabi-v7a arm64-v8a x86 x86_64"
+$ /opt/Qt/5.15.1/android/bin/qmake ../kelakon/kelakon.pro -spec android-clang CONFIG+='debug qml_debug' ANDROID_NDK_PATH=/opt/android-sdk-update-manager/ndk/21.1.6352462 ANDROID_NDK_HOST=linux-x86_64 ANDROID_TARGET_ARCH=arm64-v8a QT_ANDROID_LIBDIR=/opt/Qt/5.15.1/android/lib API=21 CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt ANDROID_ABIS=arm64-v8a
```
or so on.
diff --git a/kelakon.pro b/kelakon.pro
index a30b44e..fa19e07 100644
--- a/kelakon.pro
+++ b/kelakon.pro
@@ -20,61 +20,27 @@ LIBS += \
}
android {
- LIBS += \
- -L/opt/Qt/5.15.1/android/lib \
- -lc++
- QT += svg
- certs.path = /assets/certs
- certs.files = /usr/local/share/certs/ca-root-nss.crt
- INSTALLS += certs
-}
+ PREFIX = $$ANDROID_NDK_PATH/toolchains/llvm/prebuilt/$$ANDROID_NDK_HOST/sysroot/usr
+ TRIPLE = aarch64-linux-android
+ contains(ANDROID_TARGET_ARCH,armeabi-v7a): TRIPLE = arm-linux-androideabi
+ contains(ANDROID_TARGET_ARCH,x86): TRIPLE = i686-linux-android
+ contains(ANDROID_TARGET_ARCH,x86_64): TRIPLE = x86_64-linux-android
-contains(ANDROID_TARGET_ARCH,arm64-v8a) {
LIBS += \
- -L/opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/21 \
- -lqrtclient_arm64-v8a
+ -L$$PREFIX/lib/$$TRIPLE/$$API \
+ -L$$QT_ANDROID_LIBDIR \
+ -lqrtclient_$$ANDROID_TARGET_ARCH
ANDROID_EXTRA_LIBS += \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/21/libcrypto_1_1.so \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/21/libssl_1_1.so \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/21/libcurl.so \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/21/librtclient.so \
- /opt/Qt/5.15.1/android/lib/libqrtclient_arm64-v8a.so
-}
-
-contains(ANDROID_TARGET_ARCH,armeabi-v7a) {
- LIBS += \
- -L/opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/16 \
- -lqrtclient_armeabi-v7a
- ANDROID_EXTRA_LIBS += \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/16/libcrypto_1_1.so \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/16/libssl_1_1.so \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/16/libcurl.so \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/16/librtclient.so \
- /opt/Qt/5.15.1/android/lib/libqrtclient_armeabi-v7a.so
-}
+ $$PREFIX/lib/$$TRIPLE/$$API/libcrypto_1_1.so \
+ $$PREFIX/lib/$$TRIPLE/$$API/libssl_1_1.so \
+ $$PREFIX/lib/$$TRIPLE/$$API/libcurl.so \
+ $$PREFIX/lib/$$TRIPLE/$$API/librtclient.so \
+ $$QT_ANDROID_LIBDIR/libqrtclient_$${ANDROID_TARGET_ARCH}.so
-contains(ANDROID_TARGET_ARCH,x86) {
- LIBS += \
- -L/opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android/16 \
- -lqrtclient_x86
- ANDROID_EXTRA_LIBS += \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android/16/libcrypto_1_1.so \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android/16/libssl_1_1.so \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android/16/libcurl.so \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android/16/librtclient.so \
- /opt/Qt/5.15.1/android/lib/libqrtclient_x86.so
-}
-
-contains(ANDROID_TARGET_ARCH,x86_64) {
- LIBS += \
- -L/opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/21 \
- -lqrtclient_x86_64
- ANDROID_EXTRA_LIBS += \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/21/libcrypto_1_1.so \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/21/libssl_1_1.so \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/21/libcurl.so \
- /opt/android-sdk-update-manager/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/21/librtclient.so \
- /opt/Qt/5.15.1/android/lib/libqrtclient_x86_64.so
+ QT += svg
+ certs.path = /assets/certs
+ certs.files = /etc/ssl/certs/ca-certificates.crt
+ INSTALLS += certs
}
macx {