From 71611c90ab9387f10a2f9c66edb395b547245ca5 Mon Sep 17 00:00:00 2001 From: hwsmm <9151706+hwsmm@users.noreply.github.com> Date: Sun, 29 Jun 2025 19:47:28 +0900 Subject: [PATCH 1/4] Refactor build script and build satellite libraries for Android --- .github/workflows/build.yml | 68 ++++----- .gitignore | 2 + External/build.sh | 270 +++++++++++++++++++----------------- 3 files changed, 178 insertions(+), 162 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 59c62ab..f908f68 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,8 @@ on: # - cron: '0 0 * * *' env: BUILD_TYPE: Release + NDK_VER: 27.2.12479018 + PLATFORM_VER: 35 jobs: build: @@ -24,11 +26,32 @@ jobs: - { name: osx-x64, os: macos-13, flags: -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 } # NOTE: macOS 11.0 is the first released supported by Apple Silicon. - { name: osx-arm64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 } + - { name: android-arm64, os: ubuntu-22.04, flags: -GNinja, abi: arm64-v8a } + - { name: android-arm, os: ubuntu-22.04, flags: -GNinja, abi: armeabi-v7a } + - { name: android-x64, os: ubuntu-22.04, flags: -GNinja, abi: x86_64 } + - { name: android-x86, os: ubuntu-22.04, flags: -GNinja, abi: x86 } steps: - uses: actions/checkout@v4 with: submodules: recursive + - name: Setup JDK + if: contains(matrix.platform.name, 'android') + uses: actions/setup-java@v4 + with: + distribution: microsoft + java-version: 17 + + - name: Install Android SDK Manager + if: contains(matrix.platform.name, 'android') + uses: android-actions/setup-android@v3 + + - name: Install Android SDK + if: contains(matrix.platform.name, 'android') + run: | + sdkmanager --install "platforms;android-$PLATFORM_VER" + sdkmanager --install "ndk;$NDK_VER" + - name: Build (Linux ARM) if: contains(matrix.platform.container, 'arm') uses: addnab/docker-run-action@v3 @@ -52,6 +75,7 @@ jobs: TARGET_APT_ARCH: ${{ matrix.platform.target_apt_arch }} RUNNER_OS: ${{ runner.os }} FLAGS: ${{ matrix.platform.flags }} + ANDROID_ABI: ${{ matrix.platform.abi }} run: ./External/build.sh - name: Get Actions user id @@ -66,7 +90,12 @@ jobs: user_id: ${{ steps.get_uid.outputs.uid }} - name: Compress native directory - run: tar -cf native-${{ matrix.platform.name }}.tar native/${{ matrix.platform.name }} + if: ${{ !contains(matrix.platform.name, 'android') }} + run: tar -cvf native-${{ matrix.platform.name }}.tar native/${{ matrix.platform.name }} + + - name: Compress native directory (Android) + if: contains(matrix.platform.name, 'android') + run: tar -cvf native-${{ matrix.platform.name }}.tar native/android/${{ matrix.platform.abi }} - name: Upload native artifact uses: actions/upload-artifact@v4 @@ -100,7 +129,7 @@ jobs: cp External/SDL/Xcode/SDL/build/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Info.plist native/ios/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Info.plist; - name: Compress native directory - run: tar -cf native-ios.tar native/ios + run: tar -cvf native-ios.tar native/ios - name: Upload native artifact uses: actions/upload-artifact@v4 @@ -109,12 +138,9 @@ jobs: path: native-ios.tar if-no-files-found: error - build-android: - name: android + build-android-jar: + name: android-jar runs-on: ubuntu-22.04 - env: - NDK_VER: 23.1.7779620 - PLATFORM_VER: android-34 steps: - uses: actions/checkout@v4 with: @@ -130,22 +156,10 @@ jobs: - name: Install Android SDK Manager uses: android-actions/setup-android@v3 - with: - packages: '' - name: Install Android SDK run: | - sdkmanager --install "platform-tools" "platforms;$PLATFORM_VER" - sdkmanager --install "ndk;$NDK_VER" --channel=3 - - - name: Build (Android) - run: | - export PATH=$ANDROID_HOME/ndk/$NDK_VER:$PATH - export OUTPUT=$PWD/native/android - rm -rf $OUTPUT && mkdir -p $OUTPUT - - # Build SDL3 - ./External/SDL/build-scripts/androidbuildlibs.sh APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" NDK_LIBS_OUT="$OUTPUT" + sdkmanager --install "platforms;android-$PLATFORM_VER" - name: Build SDL3 Android Java run: | @@ -156,19 +170,9 @@ jobs: # Build SDL3 Android Java part cd ./External/SDL/android-project/app/src/main/java - javac -cp $ANDROID_HOME/platforms/$PLATFORM_VER/android.jar -encoding utf8 org/libsdl/app/*.java + javac -cp $ANDROID_HOME/platforms/android-$PLATFORM_VER/android.jar -encoding utf8 org/libsdl/app/*.java jar cvf $OUTPUT/SDL3AndroidBridge.jar org/libsdl/app/*.class - - name: Compress native directory - run: tar -cf native-android.tar native/android - - - name: Upload native artifact - uses: actions/upload-artifact@v4 - with: - name: native-android - path: native-android.tar - if-no-files-found: error - - name: Upload JAR artifact uses: actions/upload-artifact@v4 with: @@ -179,7 +183,7 @@ jobs: make-pr: name: Submit pull request runs-on: ubuntu-latest - needs: [ build, build-ios, build-android ] + needs: [ build, build-ios, build-android-jar ] steps: - uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index ad847c3..10d70d5 100644 --- a/.gitignore +++ b/.gitignore @@ -338,3 +338,5 @@ inspectcodereport.xml inspectcode sdl.json + +install_output/ diff --git a/External/build.sh b/External/build.sh index a0d1457..972f39e 100755 --- a/External/build.sh +++ b/External/build.sh @@ -5,7 +5,7 @@ set -e pushd "$(dirname "$0")" # Check if environment variables are defined -if [[ -z $NAME || -z $RUNNER_OS || -z $FLAGS ]]; then +if [[ -z $NAME || -z $RUNNER_OS || -z $FLAGS || -z $BUILD_TYPE ]]; then echo "One or more required environment variables are not defined." exit 1 fi @@ -16,153 +16,163 @@ else SUDO=$(which sudo || exit 0) fi +if [[ -n $ANDROID_ABI ]]; then + BUILD_PLATFORM="Android" +else + BUILD_PLATFORM="$RUNNER_OS" +fi + export DEBIAN_FRONTEND=noninteractive -if [[ $RUNNER_OS == 'Linux' ]]; then -# Setup Linux dependencies - if [[ $TARGET_APT_ARCH == :i386 ]]; then - $SUDO dpkg --add-architecture i386 +if [[ $BUILD_PLATFORM != 'Android' ]]; then + NATIVE_PATH="$NAME" + + if [[ $BUILD_PLATFORM == 'Linux' ]]; then + # Setup Linux dependencies + if [[ $TARGET_APT_ARCH == :i386 ]]; then + $SUDO dpkg --add-architecture i386 + fi + + $SUDO apt-get update -y -qq + + if [[ $NAME != 'linux-x86' && $NAME != 'linux-x64' ]]; then + GCC="gcc" + GPP="g++" + else + GCC="gcc-multilib" + GPP="g++-multilib" + fi + + $SUDO apt-get install -y \ + $GCC \ + $GPP \ + git \ + cmake \ + ninja-build \ + wayland-scanner++ \ + wayland-protocols \ + meson \ + pkg-config$TARGET_APT_ARCH \ + libasound2-dev$TARGET_APT_ARCH \ + libdbus-1-dev$TARGET_APT_ARCH \ + libegl1-mesa-dev$TARGET_APT_ARCH \ + libgl1-mesa-dev$TARGET_APT_ARCH \ + libgles2-mesa-dev$TARGET_APT_ARCH \ + libglu1-mesa-dev$TARGET_APT_ARCH \ + libgtk-3-dev$TARGET_APT_ARCH \ + libibus-1.0-dev$TARGET_APT_ARCH \ + libpango1.0-dev$TARGET_APT_ARCH \ + libpulse-dev$TARGET_APT_ARCH \ + libsndio-dev$TARGET_APT_ARCH \ + libudev-dev$TARGET_APT_ARCH \ + libwayland-dev$TARGET_APT_ARCH \ + libx11-dev$TARGET_APT_ARCH \ + libxcursor-dev$TARGET_APT_ARCH \ + libxext-dev$TARGET_APT_ARCH \ + libxi-dev$TARGET_APT_ARCH \ + libxinerama-dev$TARGET_APT_ARCH \ + libxkbcommon-dev$TARGET_APT_ARCH \ + libxrandr-dev$TARGET_APT_ARCH \ + libxss-dev$TARGET_APT_ARCH \ + libxt-dev$TARGET_APT_ARCH \ + libxv-dev$TARGET_APT_ARCH \ + libxxf86vm-dev$TARGET_APT_ARCH \ + libdrm-dev$TARGET_APT_ARCH \ + libgbm-dev$TARGET_APT_ARCH \ + libpulse-dev$TARGET_APT_ARCH \ + libpipewire-0.3-dev$TARGET_APT_ARCH \ + libdecor-0-dev$TARGET_APT_ARCH + fi +else + if [[ -z $ANDROID_HOME || -z $NDK_VER || -z $PLATFORM_VER || -z $ANDROID_ABI ]]; then + echo "One or more required environment variables are not defined." + exit 1 fi - $SUDO apt-get update -y -qq + NATIVE_PATH="android/$ANDROID_ABI" - if [[ $NAME != 'linux-x86' && $NAME != 'linux-x64' ]]; then - GCC="gcc" - GPP="g++" - else - GCC="gcc-multilib" - GPP="g++-multilib" - fi + export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/$NDK_VER" + export FLAGS="$FLAGS -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \ + -DANDROID_HOME=$ANDROID_HOME \ + -DANDROID_PLATFORM=$PLATFORM_VER \ + -DANDROID_ABI=$ANDROID_ABI \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH \ + -DCMAKE_INSTALL_INCLUDEDIR=include \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_INSTALL_DATAROOTDIR=share \ + -DSDL_ANDROID_JAR=OFF" $SUDO apt-get install -y \ - $GCC \ - $GPP \ - git \ - cmake \ - ninja-build \ - wayland-scanner++ \ - wayland-protocols \ - meson \ - pkg-config$TARGET_APT_ARCH \ - libasound2-dev$TARGET_APT_ARCH \ - libdbus-1-dev$TARGET_APT_ARCH \ - libegl1-mesa-dev$TARGET_APT_ARCH \ - libgl1-mesa-dev$TARGET_APT_ARCH \ - libgles2-mesa-dev$TARGET_APT_ARCH \ - libglu1-mesa-dev$TARGET_APT_ARCH \ - libgtk-3-dev$TARGET_APT_ARCH \ - libibus-1.0-dev$TARGET_APT_ARCH \ - libpango1.0-dev$TARGET_APT_ARCH \ - libpulse-dev$TARGET_APT_ARCH \ - libsndio-dev$TARGET_APT_ARCH \ - libudev-dev$TARGET_APT_ARCH \ - libwayland-dev$TARGET_APT_ARCH \ - libx11-dev$TARGET_APT_ARCH \ - libxcursor-dev$TARGET_APT_ARCH \ - libxext-dev$TARGET_APT_ARCH \ - libxi-dev$TARGET_APT_ARCH \ - libxinerama-dev$TARGET_APT_ARCH \ - libxkbcommon-dev$TARGET_APT_ARCH \ - libxrandr-dev$TARGET_APT_ARCH \ - libxss-dev$TARGET_APT_ARCH \ - libxt-dev$TARGET_APT_ARCH \ - libxv-dev$TARGET_APT_ARCH \ - libxxf86vm-dev$TARGET_APT_ARCH \ - libdrm-dev$TARGET_APT_ARCH \ - libgbm-dev$TARGET_APT_ARCH \ - libpulse-dev$TARGET_APT_ARCH \ - libpipewire-0.3-dev$TARGET_APT_ARCH \ - libdecor-0-dev$TARGET_APT_ARCH - - git config --global --add safe.directory /workspace/External/SDL - git config --global --add safe.directory /workspace/External/SDL_image - git config --global --add safe.directory /workspace/External/SDL_ttf - git config --global --add safe.directory /workspace/External/SDL_mixer + git \ + cmake \ + ninja-build \ + meson fi -# Build SDL -pushd SDL -git reset --hard HEAD || echo "Failed to clean up the repository" - -if [[ $RUNNER_OS == 'Windows' ]]; then - echo "Patching SDL to not include gameinput.h" - sed -i 's/#include /#_include /g' CMakeLists.txt +if [[ $RUNNER_OS == 'Linux' ]]; then + git config --global --add safe.directory $PWD/SDL + git config --global --add safe.directory $PWD/SDL_image + git config --global --add safe.directory $PWD/SDL_ttf + git config --global --add safe.directory $PWD/SDL_mixer fi -cmake -B build $FLAGS -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON -cmake --build build/ --config Release -$SUDO cmake --install build/ --prefix install_output --config Release -popd +CMAKE_INSTALL_PREFIX="$PWD/install_output" +rm -rf $CMAKE_INSTALL_PREFIX -# Move build lib into correct folders -if [[ $RUNNER_OS == 'Windows' ]]; then - cp SDL/install_output/bin/SDL3.dll ../native/$NAME/SDL3.dll -elif [[ $RUNNER_OS == 'Linux' ]]; then - cp SDL/install_output/lib/libSDL3.so ../native/$NAME/libSDL3.so -elif [[ $RUNNER_OS == 'macOS' ]]; then - cp SDL/install_output/lib/libSDL3.dylib ../native/$NAME/libSDL3.dylib +if [[ $BUILD_PLATFORM == 'Android' ]]; then + OUTPUT_LIB="lib/libSDL3variant.so" +elif [[ $BUILD_PLATFORM == 'Windows' ]]; then + OUTPUT_LIB="bin/SDL3variant.dll" +elif [[ $BUILD_PLATFORM == 'Linux' ]]; then + OUTPUT_LIB="lib/libSDL3variant.so" +elif [[ $BUILD_PLATFORM == 'macOS' ]]; then + OUTPUT_LIB="lib/libSDL3variant.dylib" fi -# Use the correct CMAKE_PREFIX_PATH for SDL_image and SDL_ttf, probably due differences in Cmake versions -if [[ $RUNNER_OS == 'Windows' ]]; then - CMAKE_PREFIX_PATH="../SDL/install_output/cmake/" -elif [[ $RUNNER_OS == 'Linux' ]]; then - CMAKE_PREFIX_PATH="../SDL/install_output/lib/cmake/" -elif [[ $RUNNER_OS == 'macOS' ]]; then - CMAKE_PREFIX_PATH="../SDL/install_output/lib/cmake/" +# Use the correct CMAKE_PREFIX_PATH for SDL_image and SDL_ttf, probably due differences in Cmake versions. +if [[ $BUILD_PLATFORM == 'Android' ]]; then + CMAKE_PREFIX_PATH="$CMAKE_INSTALL_PREFIX" +elif [[ $BUILD_PLATFORM == 'Windows' ]]; then + CMAKE_PREFIX_PATH="$CMAKE_INSTALL_PREFIX/cmake/" +elif [[ $BUILD_PLATFORM == 'Linux' ]]; then + CMAKE_PREFIX_PATH="$CMAKE_INSTALL_PREFIX/lib/cmake/" +elif [[ $BUILD_PLATFORM == 'macOS' ]]; then + CMAKE_PREFIX_PATH="$CMAKE_INSTALL_PREFIX/lib/cmake/" fi -# Build SDL_image -pushd SDL_image -git reset --hard HEAD +run_cmake() { + LIB_NAME=$1 + LIB_OUTPUT=$2 + + pushd $LIB_NAME + + git reset --hard HEAD || echo "Failed to clean up the repository" + + if [[ $BUILD_PLATFORM == 'Windows' && $LIB_NAME == 'SDL' ]]; then + echo "Patching SDL to not include gameinput.h" + sed -i 's/#include /#_include /g' CMakeLists.txt + fi + + rm -rf build + cmake -B build $FLAGS -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED=ON -DSDL_STATIC=OFF "${@:3}" + cmake --build build/ --config $BUILD_TYPE --verbose + cmake --install build/ --prefix $CMAKE_INSTALL_PREFIX --config $BUILD_TYPE + + # Move build lib into correct folders + cp $CMAKE_INSTALL_PREFIX/$LIB_OUTPUT ../../native/$NATIVE_PATH + + popd +} + +run_cmake SDL ${OUTPUT_LIB/variant/} + +run_cmake SDL_ttf ${OUTPUT_LIB/variant/_ttf} -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DSDLTTF_VENDORED=ON + # -DSDLIMAGE_AVIF=OFF is used because windows requires special setup to build avif support (nasm) # TODO: Add support for avif on windows (VisualC script uses dynamic imports) -cmake -B build $FLAGS -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DSDLIMAGE_AVIF=OFF -DSDLIMAGE_DEPS_SHARED=OFF -DSDLIMAGE_VENDORED=ON -cmake --build build/ --config Release -$SUDO cmake --install build/ --prefix install_output --config Release -popd +run_cmake SDL_image ${OUTPUT_LIB/variant/_image} -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DSDLIMAGE_AVIF=OFF -DSDLIMAGE_DEPS_SHARED=OFF -DSDLIMAGE_VENDORED=ON -# Move build lib into correct folders -if [[ $RUNNER_OS == 'Windows' ]]; then - cp SDL_image/install_output/bin/SDL3_image.dll ../native/$NAME/SDL3_image.dll -elif [[ $RUNNER_OS == 'Linux' ]]; then - cp SDL_image/install_output/lib/libSDL3_image.so ../native/$NAME/libSDL3_image.so -elif [[ $RUNNER_OS == 'macOS' ]]; then - cp SDL_image/install_output/lib/libSDL3_image.dylib ../native/$NAME/libSDL3_image.dylib -fi - -# Build SDL_ttf -pushd SDL_ttf -git reset --hard HEAD -cmake -B build $FLAGS -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DSDLTTF_VENDORED=ON -cmake --build build/ --config Release -$SUDO cmake --install build/ --prefix install_output --config Release -popd - -# Move build lib into correct folders -if [[ $RUNNER_OS == 'Windows' ]]; then - cp SDL_ttf/install_output/bin/SDL3_ttf.dll ../native/$NAME/SDL3_ttf.dll -elif [[ $RUNNER_OS == 'Linux' ]]; then - cp SDL_ttf/install_output/lib/libSDL3_ttf.so ../native/$NAME/libSDL3_ttf.so -elif [[ $RUNNER_OS == 'macOS' ]]; then - cp SDL_ttf/install_output/lib/libSDL3_ttf.dylib ../native/$NAME/libSDL3_ttf.dylib -fi - -# Build SDL_mixer -pushd SDL_mixer -git reset --hard HEAD -cmake -B build $FLAGS -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DSDLMIXER_VENDORED=ON -cmake --build build/ --config Release -$SUDO cmake --install build/ --prefix install_output --config Release -popd - -# Move build lib into correct folders -if [[ $RUNNER_OS == 'Windows' ]]; then - cp SDL_mixer/install_output/bin/SDL3_mixer.dll ../native/$NAME/SDL3_mixer.dll -elif [[ $RUNNER_OS == 'Linux' ]]; then - cp SDL_mixer/install_output/lib/libSDL3_mixer.so ../native/$NAME/libSDL3_mixer.so -elif [[ $RUNNER_OS == 'macOS' ]]; then - cp SDL_mixer/install_output/lib/libSDL3_mixer.dylib ../native/$NAME/libSDL3_mixer.dylib -fi +run_cmake SDL_mixer ${OUTPUT_LIB/variant/_mixer} -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DSDLMIXER_DEPS_SHARED=OFF -DSDLMIXER_VENDORED=ON popd From 1f60742d1b6c26fa0f2e00a2bb1b5672f6008f2b Mon Sep 17 00:00:00 2001 From: hwsmm <9151706+hwsmm@users.noreply.github.com> Date: Sun, 29 Jun 2025 19:49:48 +0900 Subject: [PATCH 2/4] Add Android target for satellite libraries and include Android native libraries --- README.md | 6 +++--- SDL3_image-CS/SDL3_image-CS.csproj | 5 +++-- SDL3_mixer-CS/SDL3_mixer-CS.csproj | 5 +++-- SDL3_ttf-CS/SDL3_ttf-CS.csproj | 5 +++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 08c844c..4688190 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,9 @@ Contributions to keep the bindings up-to-date with upstream changes are welcome. | Product | `win-x64` | `win-x86` | `win-arm64` | `osx-arm64` | `osx-x64` | `linux-x64` | `linux-x86` | `linux-arm64` | `linux-arm` | `ios` | `android` | |-----------------|-----------|-----------|-------------|-------------|-----------|-------------|-------------|---------------|-------------|---------|-----------| | `SDL3-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| `SDL3_image-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | -| `SDL3_ttf-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | -| `SDL3_mixer-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | +| `SDL3_image-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | +| `SDL3_ttf-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | +| `SDL3_mixer-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ## Generating bindings diff --git a/SDL3_image-CS/SDL3_image-CS.csproj b/SDL3_image-CS/SDL3_image-CS.csproj index 53c27d2..382f96d 100644 --- a/SDL3_image-CS/SDL3_image-CS.csproj +++ b/SDL3_image-CS/SDL3_image-CS.csproj @@ -1,7 +1,8 @@  - net8.0 + net8.0;net8.0-android + 21 SDL enable true @@ -72,6 +73,7 @@ runtimes/ios/native/SDL3.xcframework true + --> runtimes/android-arm/native true @@ -88,7 +90,6 @@ runtimes/android-x86/native true - --> diff --git a/SDL3_mixer-CS/SDL3_mixer-CS.csproj b/SDL3_mixer-CS/SDL3_mixer-CS.csproj index a7906d7..053fd55 100644 --- a/SDL3_mixer-CS/SDL3_mixer-CS.csproj +++ b/SDL3_mixer-CS/SDL3_mixer-CS.csproj @@ -1,7 +1,8 @@ - net8.0 + net8.0;net8.0-android + 21 SDL enable true @@ -72,6 +73,7 @@ runtimes/ios/native/SDL3.xcframework true + --> runtimes/android-arm/native true @@ -88,7 +90,6 @@ runtimes/android-x86/native true - --> diff --git a/SDL3_ttf-CS/SDL3_ttf-CS.csproj b/SDL3_ttf-CS/SDL3_ttf-CS.csproj index 3dfa620..2218524 100644 --- a/SDL3_ttf-CS/SDL3_ttf-CS.csproj +++ b/SDL3_ttf-CS/SDL3_ttf-CS.csproj @@ -1,7 +1,8 @@  - net8.0 + net8.0;net8.0-android + 21 SDL enable true @@ -72,6 +73,7 @@ runtimes/ios/native/SDL3.xcframework true + --> runtimes/android-arm/native true @@ -88,7 +90,6 @@ runtimes/android-x86/native true - --> From 4813f8dc59dbcf72b43ec684b6a421cff1f8cd85 Mon Sep 17 00:00:00 2001 From: hwsmm <9151706+hwsmm@users.noreply.github.com> Date: Sun, 29 Jun 2025 19:51:18 +0900 Subject: [PATCH 3/4] Add satellite libraries to test, and simply test availability --- SDL3-CS.Tests.Android/MainActivity.cs | 2 +- .../SDL3-CS.Tests.Android.csproj | 37 +++++++++++++++++++ SDL3-CS.Tests/Program.cs | 6 ++- SDL3-CS.Tests/SDL3-CS.Tests.csproj | 1 + 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/SDL3-CS.Tests.Android/MainActivity.cs b/SDL3-CS.Tests.Android/MainActivity.cs index 12d62f6..7408c30 100644 --- a/SDL3-CS.Tests.Android/MainActivity.cs +++ b/SDL3-CS.Tests.Android/MainActivity.cs @@ -5,7 +5,7 @@ namespace SDL.Tests.Android [Activity(Label = "SDL3-CS Android Tests", MainLauncher = true)] public class MainActivity : SDLActivity { - protected override string[] GetLibraries() => ["SDL3"]; + protected override string[] GetLibraries() => ["SDL3", "SDL3_image", "SDL3_ttf"]; protected override void Main() => Program.Main(); } diff --git a/SDL3-CS.Tests.Android/SDL3-CS.Tests.Android.csproj b/SDL3-CS.Tests.Android/SDL3-CS.Tests.Android.csproj index beaa9a7..dc98933 100644 --- a/SDL3-CS.Tests.Android/SDL3-CS.Tests.Android.csproj +++ b/SDL3-CS.Tests.Android/SDL3-CS.Tests.Android.csproj @@ -9,6 +9,7 @@ enable true SDL.Tests.Android + true @@ -32,6 +33,42 @@ x86_64 + + armeabi-v7a + + + arm64-v8a + + + x86 + + + x86_64 + + + armeabi-v7a + + + arm64-v8a + + + x86 + + + x86_64 + + + armeabi-v7a + + + arm64-v8a + + + x86 + + + x86_64 + diff --git a/SDL3-CS.Tests/Program.cs b/SDL3-CS.Tests/Program.cs index acfa9bb..84aa5b1 100644 --- a/SDL3-CS.Tests/Program.cs +++ b/SDL3-CS.Tests/Program.cs @@ -3,6 +3,9 @@ using System.Diagnostics; using System.Text; +using static SDL.SDL3_image; +using static SDL.SDL3_ttf; +using static SDL.SDL3_mixer; using static SDL.SDL3; namespace SDL.Tests @@ -25,7 +28,8 @@ namespace SDL.Tests using (var window = new MyWindow()) { - Console.WriteLine($"SDL revision: {SDL_GetRevision()}"); + // Check if satellite libraries exist. + Console.WriteLine($"SDL revision: {SDL_GetRevision()}, IMG {IMG_Version()}, TTF {TTF_Version()}, Mixer {Mix_Version()}"); printDisplays(); diff --git a/SDL3-CS.Tests/SDL3-CS.Tests.csproj b/SDL3-CS.Tests/SDL3-CS.Tests.csproj index 392e88b..f2157b3 100644 --- a/SDL3-CS.Tests/SDL3-CS.Tests.csproj +++ b/SDL3-CS.Tests/SDL3-CS.Tests.csproj @@ -24,6 +24,7 @@ + From bde92020d711d6dac8a90ef2b008299ab69281a2 Mon Sep 17 00:00:00 2001 From: hwsmm <9151706+hwsmm@users.noreply.github.com> Date: Sun, 29 Jun 2025 22:03:21 +0900 Subject: [PATCH 4/4] Add SDL3_mixer in Android test library list --- SDL3-CS.Tests.Android/MainActivity.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/SDL3-CS.Tests.Android/MainActivity.cs b/SDL3-CS.Tests.Android/MainActivity.cs index 7408c30..148cf26 100644 --- a/SDL3-CS.Tests.Android/MainActivity.cs +++ b/SDL3-CS.Tests.Android/MainActivity.cs @@ -1,12 +1,12 @@ -using Org.Libsdl.App; - -namespace SDL.Tests.Android -{ - [Activity(Label = "SDL3-CS Android Tests", MainLauncher = true)] - public class MainActivity : SDLActivity - { - protected override string[] GetLibraries() => ["SDL3", "SDL3_image", "SDL3_ttf"]; - - protected override void Main() => Program.Main(); - } -} +using Org.Libsdl.App; + +namespace SDL.Tests.Android +{ + [Activity(Label = "SDL3-CS Android Tests", MainLauncher = true)] + public class MainActivity : SDLActivity + { + protected override string[] GetLibraries() => ["SDL3", "SDL3_image", "SDL3_ttf", "SDL3_mixer"]; + + protected override void Main() => Program.Main(); + } +}