From 1fcbfe40589b01e9e62697f1eeaec3b78ad2d6b5 Mon Sep 17 00:00:00 2001 From: Dylan Perks Date: Sat, 21 Dec 2024 15:35:43 +0000 Subject: [PATCH] Add OSX build for SDL --- .github/workflows/native.yml | 8 +++++++- sources/SDL/Native/build-osx.sh | 12 ++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index cc7fbefe71..aa399ff3f9 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -61,9 +61,15 @@ jobs: strategy: matrix: flat: ${{ fromJSON(needs.prerequisites.outputs.matrix_strategy) }} - runs-on: ${{ startsWith(matrix.flat.runtime, 'osx') && 'macos-latest' || startsWith(matrix.flat.runtime, 'win') && 'windows-latest' || 'ubuntu-latest' }} + runs-on: ${{ (startsWith(matrix.flat.runtime, 'osx') || startsWith(matrix.flat.runtime, 'ios') || startsWith(matrix.flat.runtime, 'tvos')) && 'macos-latest' || startsWith(matrix.flat.runtime, 'win') && 'windows-latest' || 'ubuntu-latest' }} name: ${{ matrix.flat.target }} / ${{ matrix.flat.runtime }} steps: - uses: actions/checkout@v3 - run: ${{ format('.{0}{1}', startsWith(matrix.flat.runtime, 'win') && '\' || '/', matrix.flat.exec) }} working-directory: ${{ matrix.flat.dir }} + - uses: actions/upload-artifact@v4 + with: + name: natives-${{ matrix.flat.target }}-${{ matrix.flat.runtime }} + path: | + ${{ matrix.flat.dir }}/runtimes/${{ matrix.flat.runtime }}/**/* + ${{ matrix.flat.dir}}/lib/*${{ matrix.flat.runtime }}*/**/* diff --git a/sources/SDL/Native/build-osx.sh b/sources/SDL/Native/build-osx.sh index 1518e85782..8fee796009 100755 --- a/sources/SDL/Native/build-osx.sh +++ b/sources/SDL/Native/build-osx.sh @@ -1 +1,13 @@ #/usr/bin/env -S bash -eu +if [ ! -e ../../../eng/submodules/sdl/CMakeLists.txt ]; then + git submodule update --init --recursive --depth 1 ../../../eng/submodules/sdl +fi + +rm -rf build +mkdir build +cd build +cmake ../../../../eng/submodules/sdl "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DCMAKE_BUILD_TYPE=Release +cmake --build . --parallel +cd .. +mkdir -p runtimes/osx/native +cp build/libSDL3.dylib runtimes/osx/native