Skip to content

Commit

Permalink
Android
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kebekus committed Dec 6, 2023
1 parent ece1a9a commit 6c9dca3
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 12 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Compile on Android

on:
push:
branches: [ feature/actions ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Qt for Desktop
uses: jurplel/install-qt-action@v3
with:
cache: 'true'
cache-key-prefix: 'install-qt-action-host'
version: '6.*.*'
- name: Set QT_HOST_PATH
run: |
echo QT_HOST_PATH=$Qt6_DIR >> $GITHUB_ENV
- name: Install Qt for Android
uses: jurplel/install-qt-action@v3
with:
cache: 'true'
cache-key-prefix: 'install-qt-action-android'
modules: 'qtlocation qtpositioning'
target: 'android'
version: '6.*.*'
arch: 'android_arm64_v8a;android_armv7;android_x86;android_x86_64'
- name: Install Additional Software
run: |
sudo apt install ninja-build
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "platforms;android-33" "platform-tools" "build-tools;33.0.2"
echo ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/25.1.8937393 >> $GITHUB_ENV
- name: Remove Unwanted Software
run: |
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --uninstall "platforms;android-33-ext4" "platforms;android-33-ext5" "platforms;android-34-ext8"
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "ndk;25.1.8937393"
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: android
- name: Compile and Install
run: |
Qt6_DIR_BASE=$(dirname "$Qt6_DIR") ./buildscript-android.sh
- name: Package
run: |
tar cvfz enrouteDependencies_android.tar.gz Qt
- name: Upload to developerBuilds
run: |
gh release upload --clobber developerBuilds *.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:

jobs:
build:

runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Qt for Desktop
Expand Down
24 changes: 13 additions & 11 deletions buildscript-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ set -e

for PLATFORM in android_armv7 android_arm64_v8a android_x86 android_x86_64
do
installDir=Qt/$(basename "$Qt6_DIR_BASE")/$PLATFORM

echo
echo "libzip - static for arm64 and x86_64 on iOS"
echo "libzip - static for $PLATFORM"

$Qt6_DIR_BASE/$PLATFORM/bin/qt-cmake \
-G Ninja \
Expand All @@ -21,23 +23,23 @@ do
-DENABLE_BZIP2=OFF \
-DENABLE_LZMA=OFF \
-DENABLE_ZSTD=OFF \
-DCMAKE_INSTALL_PREFIX=$Qt6_DIR_BASE/$PLATFORM
-DCMAKE_INSTALL_PREFIX=$installDir
cmake --build build-libzip-$PLATFORM
cmake --install build-libzip-$PLATFORM


echo
echo "Android ARMv7"
echo "maplibre-native-qt - for $PLATFORMARM"

$Qt6_DIR_BASE/$PLATFORM/bin/qt-cmake \
-S maplibre-native-qt \
-B build-maplibre-native-qt-$PLATFORM \
-G Ninja \
-DBUILD_TESTING=OFF \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DCMAKE_PREFIX_PATH=$Qt6_DIR_BASE/$PLATFORM \
-DCMAKE_INSTALL_PREFIX=$Qt6_DIR_BASE/$PLATFORM
-S maplibre-native-qt \
-B build-maplibre-native-qt-$PLATFORM \
-G Ninja \
-DBUILD_TESTING=OFF \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DCMAKE_PREFIX_PATH=$Qt6_DIR_BASE/$PLATFORM \
-DCMAKE_INSTALL_PREFIX=$installDir
cmake --build build-maplibre-native-qt-$PLATFORM
cmake --install build-maplibre-native-qt-$PLATFORM
done

0 comments on commit 6c9dca3

Please sign in to comment.