Skip to content

Commit 1fcbfe4

Browse files
committed
Add OSX build for SDL
1 parent cdd18d3 commit 1fcbfe4

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/workflows/native.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,15 @@ jobs:
6161
strategy:
6262
matrix:
6363
flat: ${{ fromJSON(needs.prerequisites.outputs.matrix_strategy) }}
64-
runs-on: ${{ startsWith(matrix.flat.runtime, 'osx') && 'macos-latest' || startsWith(matrix.flat.runtime, 'win') && 'windows-latest' || 'ubuntu-latest' }}
64+
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' }}
6565
name: ${{ matrix.flat.target }} / ${{ matrix.flat.runtime }}
6666
steps:
6767
- uses: actions/checkout@v3
6868
- run: ${{ format('.{0}{1}', startsWith(matrix.flat.runtime, 'win') && '\' || '/', matrix.flat.exec) }}
6969
working-directory: ${{ matrix.flat.dir }}
70+
- uses: actions/upload-artifact@v4
71+
with:
72+
name: natives-${{ matrix.flat.target }}-${{ matrix.flat.runtime }}
73+
path: |
74+
${{ matrix.flat.dir }}/runtimes/${{ matrix.flat.runtime }}/**/*
75+
${{ matrix.flat.dir}}/lib/*${{ matrix.flat.runtime }}*/**/*

sources/SDL/Native/build-osx.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
11
#/usr/bin/env -S bash -eu
2+
if [ ! -e ../../../eng/submodules/sdl/CMakeLists.txt ]; then
3+
git submodule update --init --recursive --depth 1 ../../../eng/submodules/sdl
4+
fi
5+
6+
rm -rf build
7+
mkdir build
8+
cd build
9+
cmake ../../../../eng/submodules/sdl "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DCMAKE_BUILD_TYPE=Release
10+
cmake --build . --parallel
11+
cd ..
12+
mkdir -p runtimes/osx/native
13+
cp build/libSDL3.dylib runtimes/osx/native

0 commit comments

Comments
 (0)