From fe92d0a7bd665d732d81a6a95545d38dcc47776a Mon Sep 17 00:00:00 2001 From: mccakit Date: Fri, 3 Oct 2025 00:27:04 +0300 Subject: [PATCH] android symbol export for release builds --- CMakeLists.txt | 5 +++++ android-project/android.export.sym | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 android-project/android.export.sym diff --git a/CMakeLists.txt b/CMakeLists.txt index 77ecddeb96..5a0d478646 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1614,6 +1614,11 @@ if(ANDROID) endif() endif() endif() + if(TARGET SDL3-shared) + target_link_options(SDL3-shared PRIVATE -Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/../android-project/android.export.sym) + elseif(TARGET SDL3-static) + target_link_options(SDL3-static PRIVATE -Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/../android-project/android.export.sym) + endif() elseif(EMSCRIPTEN) # Hide noisy warnings that intend to aid mostly during initial stages of porting a new diff --git a/android-project/android.export.sym b/android-project/android.export.sym new file mode 100644 index 0000000000..5beaa534d9 --- /dev/null +++ b/android-project/android.export.sym @@ -0,0 +1,6 @@ +{ + global: + SDL_main; + JNI_OnLoad; + local: *; +};