From dbcfd9b9d3758ffe663b2d8a96367bac93666860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Fri, 15 Dec 2023 15:04:55 +0100 Subject: [PATCH] Added Google Protocol Buffers to Android build --- .github/workflows/android.yml | 4 +++- pbfplugin.pro | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index f24a40b..e4042b3 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -41,7 +41,9 @@ jobs: version: '6.4.0' target: 'android' arch: 'android_arm64_v8a' + - name: Install Android Google Protocol Buffers + run: git clone https://github.com/tumic0/android_protobuf.git - name: Configure build - run: qmake pbfplugin.pro + run: qmake pbfplugin.pro PROTOBUF=android_protobuf - name: Build project run: make -j2 diff --git a/pbfplugin.pro b/pbfplugin.pro index 03e2073..c38c098 100644 --- a/pbfplugin.pro +++ b/pbfplugin.pro @@ -39,7 +39,7 @@ RESOURCES += pbfplugin.qrc DEFINES += QT_NO_DEPRECATED_WARNINGS -unix:!macx{ +unix:!macx:!android { LIBS += -lprotobuf-lite \ -lz } @@ -58,6 +58,11 @@ macx { LIBS += $$PROTOBUF/lib/libprotobuf-lite.a \ -lz } +android { + INCLUDEPATH += $$PROTOBUF/include + LIBS += $$PROTOBUF/$$ANDROID_TARGET_ARCH/libprotobuf-lite.a \ + -lz +} target.path += $$[QT_INSTALL_PLUGINS]/imageformats INSTALLS += target