-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (83 loc) · 3.28 KB
/
cmake-sdl3-android.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build SDL3 Libraries (Android)
on: [workflow_dispatch]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
arch: x86_64
steps:
- uses: actions/checkout@v4.1.7
with:
repository: 'libsdl-org/SDL'
ref: 'preview-3.1.3'
path: 'SDL'
- name: Install dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Install Android SDK Command-Line Tools
run: |
wget https://dl.google.com/android/repository/commandlinetools-linux-10406996_latest.zip -O android-sdk-tools.zip
unzip android-sdk-tools.zip -d tools
mkdir $HOME/android-sdk/
mkdir $HOME/android-sdk/cmdline-tools/
mkdir $HOME/android-sdk/cmdline-tools/latest/
mv ./tools/cmdline-tools/* $HOME/android-sdk/cmdline-tools/latest/
chmod +x $HOME/android-sdk/cmdline-tools/latest/bin/*
echo "ANDROID_HOME=$HOME/android-sdk" >> $GITHUB_ENV
echo "ANDROID_SDK_ROOT=$HOME/android-sdk" >> $GITHUB_ENV
- name: Accept Android SDK Licenses
run: |
yes | $HOME/android-sdk/cmdline-tools/latest/bin/sdkmanager --licenses
- name: Install Specific Android NDK Version 26.3.11579264
run: |
yes | $HOME/android-sdk/cmdline-tools/latest/bin/sdkmanager --install "ndk;26.3.11579264"
echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/26.3.11579264" >> $GITHUB_ENV
echo "PATH=$PATH:$ANDROID_HOME/ndk/26.3.11579264" >> $GITHUB_ENV
- name: Build for arm64-v8a
run: |
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=Android \
-DCMAKE_ANDROID_NDK=$ANDROID_NDK_HOME \
-DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \
-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \
-DCMAKE_ANDROID_STL_TYPE=c++_shared \
-DCMAKE_ANDROID_API=21 \
-DANDROID_NDK=$ANDROID_NDK_HOME \
-DSDL_STATIC=OFF \
-DSDL_SHARED=ON \
-S SDL \
-B SDL/build/arm64-v8a
cmake --build SDL/build/arm64-v8a --config Release
- name: Build for x86_64
run: |
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=Android \
-DCMAKE_ANDROID_NDK=$ANDROID_NDK_HOME \
-DCMAKE_ANDROID_ARCH_ABI=x86_64 \
-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \
-DCMAKE_ANDROID_STL_TYPE=c++_shared \
-DCMAKE_ANDROID_API=21 \
-DANDROID_NDK=$ANDROID_NDK_HOME \
-DSDL_STATIC=OFF \
-DSDL_SHARED=ON \
-S SDL \
-B SDL/build/x86_64
cmake --build SDL/build/x86_64 --config Release
- name: Upload Artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: sdl3-android-latest-all-artifacts
path: |
SDL/build/arm64-v8a/*.so
SDL/build/x86_64/*.so
if-no-files-found: ignore # 'warn' or 'ignore' or 'error'