From d7e343d03b074f539e780df909381bb508143014 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:00:44 +0300 Subject: [PATCH] Try fix libretro android again --- CMakeLists.txt | 4 +--- src/jni_driver.cpp | 10 +++++----- src/libretro_core.cpp | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aff024cf..de8728f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -201,9 +201,7 @@ target_include_directories(boost SYSTEM INTERFACE ${Boost_INCLUDE_DIR}) if(ANDROID) set(CRYPTOPP_OPT_DISABLE_ASM ON CACHE BOOL "" FORCE) - if(NOT BUILD_LIBRETRO_CORE) - target_sources(AlberCore PRIVATE src/jni_driver.cpp) - endif() + target_sources(AlberCore PRIVATE src/jni_driver.cpp) target_link_libraries(AlberCore PRIVATE EGL log) endif() diff --git a/src/jni_driver.cpp b/src/jni_driver.cpp index 6a156360..7274c9c4 100644 --- a/src/jni_driver.cpp +++ b/src/jni_driver.cpp @@ -10,11 +10,11 @@ #include "android_utils.hpp" #include "sdl_sensors.hpp" -std::unique_ptr emulator = nullptr; -HIDService* hidService = nullptr; -RendererGL* renderer = nullptr; -bool romLoaded = false; -JavaVM* jvm = nullptr; +static std::unique_ptr emulator = nullptr; +static HIDService* hidService = nullptr; +static RendererGL* renderer = nullptr; +static bool romLoaded = false; +static JavaVM* jvm = nullptr; jclass alberClass; jmethodID alberClassOpenDocument; diff --git a/src/libretro_core.cpp b/src/libretro_core.cpp index aca8330d..b44687b2 100644 --- a/src/libretro_core.cpp +++ b/src/libretro_core.cpp @@ -19,8 +19,8 @@ static std::filesystem::path savePath; static bool screenTouched = false; static bool usingGLES = false; -std::unique_ptr emulator; -RendererGL* renderer; +static std::unique_ptr 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"); }