From b7634e9366271585317ec9dfab606fd86c809062 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Wed, 22 Dec 2021 14:59:48 +0900 Subject: [PATCH] Android: Update build instructions Require CMake 3.20+, because after upgrading the Android Gradle plugin build with CMake <3.20 fails with the following error: Execution failed for task ':app:buildCMakeDebug'. > Expected output file at (...)obj/armeabi-v7a/libSDL2.so for target SDL2 but there was none --- android/README.md | 11 ++++++----- android/app/jni/CMakeLists.txt | 4 ---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/android/README.md b/android/README.md index dd69211..0361328 100644 --- a/android/README.md +++ b/android/README.md @@ -5,7 +5,7 @@ Prebuilt APKs are [here](https://github.com/kichikuou/system3-sdl2/releases). ## Build Prerequisites: -- CMake >=3.13 +- CMake >=3.20 - Android SDK >=28 - Android NDK >=r15c @@ -20,16 +20,17 @@ Then open `system3-sdl2/android` directory as an Android Studio project. ### Command line build Configure environment variables and run the `gradlew` script in this folder. -Example build instructions (for Debian buster): +Example build instructions (for Debian bullseye): ```sh # Install necessary packages -sudo apt install git wget unzip default-jdk-headless cmake ninja-build +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-7302050_latest.zip -unzip commandlinetools-linux-7302050_latest.zip -d $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 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 diff --git a/android/app/jni/CMakeLists.txt b/android/app/jni/CMakeLists.txt index 7a347a3..ef11777 100644 --- a/android/app/jni/CMakeLists.txt +++ b/android/app/jni/CMakeLists.txt @@ -2,10 +2,6 @@ cmake_minimum_required(VERSION 3.13) project(GAME) -# armeabi-v7a requires cpufeatures library -# include(AndroidNdkModules) -# android_ndk_import_module_cpufeatures() - include(FetchContent) FetchContent_Declare( SDL