Skip to content

Commit 704ed4f

Browse files
committed
Added SDL3 Image
1 parent ee23be1 commit 704ed4f

File tree

2 files changed

+172
-2
lines changed

2 files changed

+172
-2
lines changed

.github/workflows/cmake-sdl2-android.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ jobs:
7171
-DCMAKE_ANDROID_STL_TYPE=c++_shared \
7272
-DCMAKE_ANDROID_API=21 \
7373
-DANDROID_NDK=$ANDROID_NDK_HOME \
74-
-DSDL_STATIC=ON \
74+
-DSDL_STATIC=OFF \
7575
-DSDL_SHARED=ON \
76+
-DSDL_TEST=OFF \
7677
-S ./ \
7778
-B ./build/arm64-v8a
7879
cmake --build ./build/arm64-v8a --config Release
@@ -88,8 +89,9 @@ jobs:
8889
-DCMAKE_ANDROID_STL_TYPE=c++_shared \
8990
-DCMAKE_ANDROID_API=21 \
9091
-DANDROID_NDK=$ANDROID_NDK_HOME \
91-
-DSDL_STATIC=ON \
92+
-DSDL_STATIC=OFF \
9293
-DSDL_SHARED=ON \
94+
-DSDL_TEST=OFF \
9395
-S ./ \
9496
-B ./build/x86_64
9597
cmake --build ./build/x86_64 --config Release

.github/workflows/cmake-sdl3.yml

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
name: Build SDL3 Image Libraries
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
include:
11+
- os: ubuntu-latest
12+
arch: x86_64
13+
cmake-arch: x64
14+
vcpkg-triplet: x64-linux
15+
- os: linux
16+
arch: arm64
17+
cmake-arch: aarch64
18+
vcpkg-triplet: arm64-linux
19+
runner-label: self-hosted
20+
- os: windows-latest
21+
arch: x86_64
22+
cmake-arch: x64
23+
vcpkg-triplet: x64-windows
24+
- os: windows-latest
25+
arch: x86
26+
cmake-arch: win32
27+
vcpkg-triplet: x86-windows
28+
- os: windows-latest
29+
arch: arm64
30+
cmake-arch: arm64
31+
vcpkg-triplet: arm64-windows
32+
- os: macos-latest
33+
arch: x86_64
34+
cmake-arch: x86_64
35+
vcpkg-triplet: x64-osx
36+
- os: macos-latest
37+
arch: arm64
38+
cmake-arch: arm64
39+
vcpkg-triplet: arm64-osx
40+
41+
steps:
42+
- uses: actions/checkout@v4.1.7
43+
with:
44+
repository: 'libsdl-org/SDL_image'
45+
path: 'SDLImage'
46+
ref: 'release-3.2.4'
47+
submodules: true
48+
49+
- uses: actions/checkout@v4.1.7
50+
with:
51+
repository: 'libsdl-org/SDL'
52+
ref: 'release-3.2.10'
53+
path: 'SDLImage/SDL'
54+
submodules: true
55+
56+
- name: Install dependencies on Ubuntu
57+
if: matrix.os == 'linux' || matrix.os == 'ubuntu-latest'
58+
run: |
59+
sudo apt-get update && sudo apt-get install -y \
60+
build-essential \
61+
cmake \
62+
libasound2-dev \
63+
libpulse-dev \
64+
libaudio-dev \
65+
libx11-dev \
66+
libxext-dev \
67+
libxrandr-dev \
68+
libxcursor-dev \
69+
libxfixes-dev \
70+
libxi-dev \
71+
libxinerama-dev \
72+
libxss-dev \
73+
libwayland-dev \
74+
libwayland-egl-backend-dev \
75+
libdbus-1-dev \
76+
libudev-dev \
77+
libgles2-mesa-dev \
78+
libegl1-mesa-dev \
79+
libgl1-mesa-dev \
80+
libibus-1.0-dev \
81+
fcitx-libs-dev \
82+
libsamplerate0-dev \
83+
ccache \
84+
libjack-jackd2-dev \
85+
libdrm-dev \
86+
libpipewire-0.3-dev \
87+
libvulkan-dev \
88+
libdecor-0-dev \
89+
qtwayland5 \
90+
libxkbcommon-dev \
91+
libsndio-dev \
92+
libpng-dev \
93+
libjpeg-dev \
94+
libtiff-dev \
95+
libwebp-dev \
96+
libavif-dev
97+
98+
- name: Install Dependencies on macOS
99+
if: matrix.os == 'macos-latest'
100+
run: |
101+
brew install libpng jpeg libtiff webp libavif
102+
103+
- name: Install Dependencies on Windows
104+
if: runner.os == 'Windows'
105+
run: choco install nasm
106+
107+
- name: Configure SDL with CMake on Linux (x86_64)
108+
if: matrix.os == 'linux' || matrix.os == 'ubuntu-latest'
109+
run: |
110+
cd SDLImage/SDL
111+
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release -DSDL_STATIC=OFF -DSDL_SHARED=ON -DSDL_TEST=OFF
112+
113+
- name: Configure SDL with CMake for macOS ARM64
114+
if: matrix.os == 'macos-latest'
115+
run: |
116+
cd SDLImage/SDL
117+
cmake -S . -B ./build -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake-arch }} -DCMAKE_BUILD_TYPE=Release -DSDL_STATIC=OFF -DSDL_SHARED=ON -DSDL_TEST=OFF
118+
119+
- name: Configure SDL with CMake for Windows
120+
if: matrix.os == 'windows-latest'
121+
run: |
122+
cd SDLImage/SDL
123+
cmake -S . -B ./build -A ${{ matrix.cmake-arch }} -DCMAKE_BUILD_TYPE=Release -DSDL_STATIC=OFF -DSDL_SHARED=ON -DSDL_TEST=OFF
124+
125+
- name: Build SDL3
126+
run: |
127+
cd SDLImage/SDL
128+
cmake --build ./build --config Release
129+
cmake --install ./build --config Release --prefix install
130+
131+
- name: Configure SDLImage with CMake for Linux
132+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'linux'
133+
run: |
134+
cd SDLImage
135+
cmake -S ./ -B ./build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DSDLIMAGE_SAMPLES=OFF -DSDLIMAGE_TESTS=OFF -DCMAKE_PREFIX_PATH="./SDL/install"
136+
137+
- name: Configure SDLImage with CMake for Windows
138+
if: matrix.os == 'windows-latest'
139+
run: |
140+
cd SDLImage
141+
cmake -S ./ -B ./build -A ${{ matrix.cmake-arch }} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DSDLIMAGE_SAMPLES=OFF -DSDLIMAGE_TESTS=OFF -DCMAKE_PREFIX_PATH="./SDL/install"
142+
143+
- name: Configure SDLImage with CMake for macOS
144+
if: matrix.os == 'macos-latest'
145+
run: |
146+
cd SDLImage
147+
cmake -S ./ -B ./build -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake-arch }} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DSDLIMAGE_SAMPLES=OFF -DSDLIMAGE_TESTS=OFF -DCMAKE_PREFIX_PATH="./SDL/install"
148+
149+
- name: Build SDLImage
150+
run: |
151+
cd SDLImage
152+
cmake --build ./build --config Release
153+
154+
- name: Move Windows binaries
155+
if: matrix.os == 'windows-latest'
156+
run: |
157+
cd SDLImage
158+
mv ./build/Release/*.dll ./build/
159+
160+
- name: Upload Artifacts
161+
uses: actions/upload-artifact@v4.3.4
162+
with:
163+
name: sdl3-image-${{ matrix.os }}-${{ matrix.arch }}-artifacts
164+
path: |
165+
SDLImage/build/*.dll
166+
SDLImage/build/*.so
167+
SDLImage/build/*.dylib
168+
if-no-files-found: ignore # 'warn' or 'ignore' or 'error'

0 commit comments

Comments
 (0)