From 8222bfe56d4dabe8d92fc4b25ea1b0163b16f3e1 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 4 May 2024 16:51:29 -0700 Subject: Initial commit. --- .../SDL-2.30.2/.github/workflows/android.yml | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 src/contrib/SDL-2.30.2/.github/workflows/android.yml (limited to 'src/contrib/SDL-2.30.2/.github/workflows/android.yml') diff --git a/src/contrib/SDL-2.30.2/.github/workflows/android.yml b/src/contrib/SDL-2.30.2/.github/workflows/android.yml new file mode 100644 index 0000000..a2d2b0b --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/android.yml @@ -0,0 +1,81 @@ +name: Build (Android) + +on: [push, pull_request] + +jobs: + android: + name: ${{ matrix.platform.name }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + platform: + - { name: Android.mk } + - { name: CMake, cmake: 1, android_abi: "arm64-v8a", android_platform: 23, arch: "aarch64" } + + steps: + - uses: actions/checkout@v4 + - uses: nttld/setup-ndk@v1 + id: setup_ndk + with: + ndk-version: r21e + - name: Build (Android.mk) + if: ${{ matrix.platform.name == 'Android.mk' }} + run: | + ./build-scripts/androidbuildlibs.sh + - name: Setup (CMake) + if: ${{ matrix.platform.name == 'CMake' }} + run: | + sudo apt-get update + sudo apt-get install ninja-build pkg-config + - name: Configure (CMake) + if: ${{ matrix.platform.name == 'CMake' }} + run: | + cmake -B build \ + -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \ + -DSDL_WERROR=ON \ + -DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \ + -DANDROID_ABI=${{ matrix.platform.android_abi }} \ + -DSDL_STATIC_PIC=ON \ + -DSDL_VENDOR_INFO="Github Workflow" \ + -DCMAKE_INSTALL_PREFIX=prefix \ + -DCMAKE_BUILD_TYPE=Release \ + -GNinja + - name: Build (CMake) + if: ${{ matrix.platform.name == 'CMake' }} + run: | + cmake --build build --config Release --parallel --verbose + - name: Install (CMake) + if: ${{ matrix.platform.name == 'CMake' }} + run: | + cmake --install build --config Release + echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV + ( cd prefix; find ) | LC_ALL=C sort -u + - name: Verify CMake configuration files + if: ${{ matrix.platform.name == 'CMake' }} + run: | + cmake -S cmake/test -B cmake_config_build -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \ + -DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \ + -DANDROID_ABI=${{ matrix.platform.android_abi }} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} + cmake --build cmake_config_build --verbose + - name: Verify sdl2-config + if: ${{ matrix.platform.name == 'CMake' }} + run: | + export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}" + export PATH=${{ env.SDL2_DIR }}/bin:$PATH + cmake/test/test_sdlconfig.sh + - name: Verify sdl2.pc + if: ${{ matrix.platform.name == 'CMake' }} + run: | + export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}" + export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig + cmake/test/test_pkgconfig.sh + - name: Verify Android.mk + if: ${{ matrix.platform.name == 'CMake' }} + run: | + export NDK_MODULE_PATH=${{ env.SDL2_DIR }}/share/ndk-modules + ndk-build -C ${{ github.workspace }}/cmake/test APP_PLATFORM=android-${{ matrix.platform.android_platform }} APP_ABI=${{ matrix.platform.android_abi }} NDK_OUT=$PWD NDK_LIBS_OUT=$PWD V=1 -- cgit v1.2.3