Skip to content

Commit ad372d5

Browse files
superzazumadebrsezero
committed
upgrade to SDL3
Co-authored-by: Anonymous Maarten <[email protected]> Co-authored-by: Ozkan Sezer <[email protected]>
1 parent 474dbf7 commit ad372d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+890
-1081
lines changed

.github/workflows/main.yml

+27-20
Original file line numberDiff line numberDiff line change
@@ -18,45 +18,52 @@ jobs:
1818
- { name: MacOS, os: macos-latest, shell: sh }
1919
- { name: mingw-w64 (i686), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 }
2020
- { name: mingw-w64 (x86_64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
21-
- { name: MSVC (x86), os: windows-latest, shell: pwsh, flags: "-DCMAKE_TOOLCHAIN_FILE=C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake -A Win32", vcpkg: x86-windows }
22-
- { name: MSVC (x64), os: windows-latest, shell: pwsh, flags: "-DCMAKE_TOOLCHAIN_FILE=C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake -A x64", vcpkg: x64-windows }
23-
- { name: MSVC (ARM64), os: windows-latest, shell: pwsh, flags: "-DCMAKE_TOOLCHAIN_FILE=C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake -A ARM64", vcpkg: arm64-windows }
24-
21+
- { name: MSVC (x86), os: windows-latest, shell: pwsh, msvc: 1, msvc-arch: amd64_x86 }
22+
- { name: MSVC (x64), os: windows-latest, shell: pwsh, msvc: 1, msvc-arch: amd64 }
23+
- { name: MSVC (ARM64), os: windows-latest, shell: pwsh, msvc: 1, msvc-arch: amd64_arm64 }
24+
2525
steps:
26+
- uses: ilammy/msvc-dev-cmd@v1
27+
if: ${{ matrix.platform.msvc }}
28+
with:
29+
arch: ${{ matrix.platform.msvc-arch }}
2630
- name: Setup Linux dependencies
2731
if: runner.os == 'Linux'
2832
run: |
2933
sudo apt-get update
30-
sudo apt-get install cmake ninja-build libsdl2-dev
31-
- name: Setup MacOS dependencies
32-
if: runner.os == 'MacOS'
33-
run: |
34-
brew install sdl2
35-
- name: Set up MSYS2 dependencies
36-
if: matrix.platform.shell == 'msys2 {0}'
34+
sudo apt-get install cmake ninja-build
35+
- name: Set up MSYS2
36+
if: ${{ matrix.platform.shell == 'msys2 {0}' }}
3737
uses: msys2/setup-msys2@v2
3838
with:
3939
msystem: ${{ matrix.platform.msystem }}
4040
install: >-
4141
${{ matrix.platform.msys-env }}-gcc
4242
${{ matrix.platform.msys-env }}-cmake
4343
${{ matrix.platform.msys-env }}-ninja
44-
${{ matrix.platform.msys-env }}-SDL2
45-
- name: Setup MSVC dependencies
46-
if: matrix.platform.vcpkg != ''
47-
run: |
48-
vcpkg install --triplet ${{ matrix.platform.vcpkg }} sdl2
49-
44+
- name: Set up Ninja
45+
uses: aseprite/get-ninja@main
46+
if: ${{ !contains(matrix.platform.shell, 'msys2') }}
47+
- name: Set up SDL
48+
id: sdl
49+
uses: libsdl-org/setup-sdl@main
50+
with:
51+
cmake-generator: Ninja
52+
version: 3-head
53+
sdl-test: false
54+
shell: ${{ matrix.platform.shell }}
5055
- name: Get SDL_sound sources
5156
uses: actions/checkout@v3
5257
- name: Configure (CMake)
53-
run: cmake -B build -DSDLSOUND_DECODER_MIDI=ON ${{ matrix.platform.flags }} -DCMAKE_INSTALL_PREFIX=prefix -DCMAKE_BUILD_TYPE=Release
58+
run: |
59+
cmake -B build -DSDLSOUND_DECODER_MIDI=ON -GNinja -DCMAKE_INSTALL_PREFIX=prefix -DCMAKE_BUILD_TYPE=Release
5460
- name: Build (CMake)
55-
run: cmake --build build/ --config Release
61+
run: |
62+
cmake --build build/ --config Release
5663
- name: Install (CMake)
5764
run: |
5865
cmake --install build/ --config Release
5966
- name: Verify CMake configuration files
6067
run: |
61-
cmake -S cmake/test -B build_cmake_test ${{ matrix.platform.flags }} -DCMAKE_PREFIX_PATH="${{ github.workspace }}/prefix" -DCMAKE_BUILD_TYPE=Release
68+
cmake -S cmake/test -B build_cmake_test -GNinja -DCMAKE_PREFIX_PATH="${{ github.workspace }}/prefix" -DCMAKE_BUILD_TYPE=Release
6269
cmake --build build_cmake_test --verbose --config Release

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SDL2_sound.pc
1+
SDL3_sound.pc
22

33
*.so
44
*.so.*
@@ -35,3 +35,7 @@ RelWithDebInfo
3535

3636
playsound
3737
playsound_simple
38+
39+
.DS_Store
40+
build
41+
.vscode

Android.mk

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ LOCAL_PATH := $(call my-dir)
22

33
include $(CLEAR_VARS)
44

5-
LOCAL_MODULE := SDL2_sound
5+
LOCAL_MODULE := SDL3_sound
66

77
SUPPORT_MIDI ?= false
88

99

1010
SUPPORT_MODPLUG ?= true
1111

1212

13-
LOCAL_C_INCLUDES := $(LOCAL_PATH)/src
13+
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
1414
LOCAL_CFLAGS :=
1515

1616
LOCAL_SRC_FILES := $(LOCAL_PATH)/src/SDL_sound.c \
@@ -42,7 +42,7 @@ else
4242
LOCAL_CFLAGS += -DSOUND_SUPPORTS_MODPLUG=0
4343
endif
4444

45-
LOCAL_SHARED_LIBRARIES := SDL2
45+
LOCAL_SHARED_LIBRARIES := SDL3
4646

4747
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
4848

0 commit comments

Comments
 (0)