mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-08 14:58:13 +03:00
Android: Use SDK-bundled CMake 3.22.1
This commit is contained in:
+3
-5
@@ -5,7 +5,6 @@ Prebuilt APKs are [here](https://github.com/kichikuou/system3-sdl2/releases).
|
||||
|
||||
## Build
|
||||
Prerequisites:
|
||||
- CMake >=3.20
|
||||
- Android SDK >=28
|
||||
- Android NDK >=r15c
|
||||
|
||||
@@ -24,16 +23,15 @@ Example build instructions (for Debian bullseye):
|
||||
```sh
|
||||
# Install necessary packages
|
||||
sudo apt install git wget unzip default-jdk-headless ninja-build
|
||||
sudo apt install -t bullseye-backports cmake
|
||||
|
||||
# Install Android SDK / NDK
|
||||
export ANDROID_SDK_ROOT=$HOME/android-sdk
|
||||
mkdir -p $ANDROID_SDK_ROOT/cmdline-tools
|
||||
wget https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip
|
||||
unzip commandlinetools-linux-7583922_latest.zip -d $ANDROID_SDK_ROOT/cmdline-tools
|
||||
wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
|
||||
unzip commandlinetools-linux-8512546_latest.zip -d $ANDROID_SDK_ROOT/cmdline-tools
|
||||
mv $ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools $ANDROID_SDK_ROOT/cmdline-tools/tools
|
||||
yes |$ANDROID_SDK_ROOT/cmdline-tools/tools/bin/sdkmanager --licenses
|
||||
$ANDROID_SDK_ROOT/cmdline-tools/tools/bin/sdkmanager ndk-bundle
|
||||
$ANDROID_SDK_ROOT/cmdline-tools/tools/bin/sdkmanager ndk-bundle 'cmake;3.22.1'
|
||||
export ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk-bundle
|
||||
|
||||
# Check out and build system3-sdl2
|
||||
|
||||
@@ -44,9 +44,7 @@ android {
|
||||
}
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
// system3 requires CMake >=3.13, so SDK-bundled CMake
|
||||
// (3.6 or 3.10.2) cannot be used.
|
||||
version getInstalledCmakeVersion()
|
||||
version '3.22.1'
|
||||
path 'jni/CMakeLists.txt'
|
||||
}
|
||||
}
|
||||
@@ -73,7 +71,3 @@ dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
}
|
||||
|
||||
static String getInstalledCmakeVersion() {
|
||||
('cmake --version'.execute().text =~ /cmake version ([0-9.]+)/)[0][1]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user