Build Android libretro core on CI (#797)

* Attempt to build Android libretro core on CI

* Hopefully fix Android libretro compilation

* Try fix libretro android again

* Fix SO name

* Rename .so again

* Nit

* Update Android Libretro build

* Remove ccache for Android libretro
This commit is contained in:
wheremyfoodat 2025-07-31 17:04:15 +03:00 committed by GitHub
commit 2699dcd82e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 36 additions and 7 deletions

View file

@ -213,3 +213,32 @@ jobs:
path: |
${{github.workspace}}/build/panda3ds_libretro.so
${{github.workspace}}/docs/libretro/panda3ds_libretro.info
ARM-Libretro-Android:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Fetch submodules
run: git submodule update --init --recursive
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DBUILD_LIBRETRO_CORE=1 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DENABLE_VULKAN=0 -DENABLE_USER_BUILD=ON -DCMAKE_CXX_FLAGS="-march=armv8-a+crypto"
- name: Build
run: |
# Apply patch for GLES compatibility
git apply ./.github/gles.patch
# Build the project with CMake
cmake --build ${{github.workspace}}/build --config ${{ env.BUILD_TYPE }}
# Strip the generated library
${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded ./build/panda3ds_libretro.so
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Android arm64 Libretro core
path: |
${{github.workspace}}/build/panda3ds_libretro.so
${{github.workspace}}/docs/libretro/panda3ds_libretro.info

View file

@ -10,11 +10,11 @@
#include "android_utils.hpp"
#include "sdl_sensors.hpp"
std::unique_ptr<Emulator> emulator = nullptr;
HIDService* hidService = nullptr;
RendererGL* renderer = nullptr;
bool romLoaded = false;
JavaVM* jvm = nullptr;
static std::unique_ptr<Emulator> emulator = nullptr;
static HIDService* hidService = nullptr;
static RendererGL* renderer = nullptr;
static bool romLoaded = false;
static JavaVM* jvm = nullptr;
jclass alberClass;
jmethodID alberClassOpenDocument;

View file

@ -19,8 +19,8 @@ static std::filesystem::path savePath;
static bool screenTouched = false;
static bool usingGLES = false;
std::unique_ptr<Emulator> emulator;
RendererGL* renderer;
static std::unique_ptr<Emulator> emulator;
static RendererGL* renderer;
std::filesystem::path Emulator::getConfigPath() { return std::filesystem::path(savePath / "config.toml"); }
std::filesystem::path Emulator::getAppDataRoot() { return std::filesystem::path(savePath / "Emulator Files"); }