Skip to content

Commit

Permalink
upgrade to SDL3
Browse files Browse the repository at this point in the history
Co-authored-by: Anonymous Maarten <[email protected]>
Co-authored-by: Ozkan Sezer <[email protected]>
  • Loading branch information
3 people committed Dec 25, 2024
1 parent 5d983db commit ec6d222
Show file tree
Hide file tree
Showing 43 changed files with 886 additions and 1,069 deletions.
47 changes: 27 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,52 @@ jobs:
- { name: MacOS, os: macos-latest, shell: sh }
- { name: mingw-w64 (i686), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 }
- { name: mingw-w64 (x86_64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
- { name: MSVC (x86), os: windows-latest, shell: pwsh, flags: "-DCMAKE_TOOLCHAIN_FILE=C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake -A Win32", vcpkg: x86-windows }
- { name: MSVC (x64), os: windows-latest, shell: pwsh, flags: "-DCMAKE_TOOLCHAIN_FILE=C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake -A x64", vcpkg: x64-windows }
- { name: MSVC (ARM64), os: windows-latest, shell: pwsh, flags: "-DCMAKE_TOOLCHAIN_FILE=C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake -A ARM64", vcpkg: arm64-windows }
- { name: MSVC (x86), os: windows-latest, shell: pwsh, msvc: 1, msvc-arch: amd64_x86 }
- { name: MSVC (x64), os: windows-latest, shell: pwsh, msvc: 1, msvc-arch: amd64 }
- { name: MSVC (ARM64), os: windows-latest, shell: pwsh, msvc: 1, msvc-arch: amd64_arm64 }

steps:
- uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.platform.msvc }}
with:
arch: ${{ matrix.platform.msvc-arch }}
- name: Setup Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install cmake ninja-build libsdl2-dev
- name: Setup MacOS dependencies
if: runner.os == 'MacOS'
run: |
brew install sdl2
- name: Set up MSYS2 dependencies
if: matrix.platform.shell == 'msys2 {0}'
sudo apt-get install cmake ninja-build
- name: Set up MSYS2
if: ${{ matrix.platform.shell == 'msys2 {0}' }}
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.platform.msystem }}
install: >-
${{ matrix.platform.msys-env }}-gcc
${{ matrix.platform.msys-env }}-cmake
${{ matrix.platform.msys-env }}-ninja
${{ matrix.platform.msys-env }}-SDL2
- name: Setup MSVC dependencies
if: matrix.platform.vcpkg != ''
run: |
vcpkg install --triplet ${{ matrix.platform.vcpkg }} sdl2
- name: Set up Ninja
uses: aseprite/get-ninja@main
if: ${{ !contains(matrix.platform.shell, 'msys2') }}
- name: Set up SDL
id: sdl
uses: libsdl-org/setup-sdl@main
with:
cmake-generator: Ninja
version: 3-head
sdl-test: false
shell: ${{ matrix.platform.shell }}
- name: Get SDL_sound sources
uses: actions/checkout@v3
- name: Configure (CMake)
run: cmake -B build -DSDLSOUND_DECODER_MIDI=ON ${{ matrix.platform.flags }} -DCMAKE_INSTALL_PREFIX=prefix -DCMAKE_BUILD_TYPE=Release
run: |
cmake -B build -DSDLSOUND_DECODER_MIDI=ON -GNinja -DCMAKE_INSTALL_PREFIX=prefix -DCMAKE_BUILD_TYPE=Release
- name: Build (CMake)
run: cmake --build build/ --config Release
run: |
cmake --build build/ --config Release
- name: Install (CMake)
run: |
cmake --install build/ --config Release
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B build_cmake_test ${{ matrix.platform.flags }} -DCMAKE_PREFIX_PATH="${{ github.workspace }}/prefix" -DCMAKE_BUILD_TYPE=Release
cmake -S cmake/test -B build_cmake_test -GNinja -DCMAKE_PREFIX_PATH="${{ github.workspace }}/prefix" -DCMAKE_BUILD_TYPE=Release
cmake --build build_cmake_test --verbose --config Release
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SDL2_sound.pc
SDL3_sound.pc

*.so
*.so.*
Expand Down Expand Up @@ -35,3 +35,7 @@ RelWithDebInfo

playsound
playsound_simple

.DS_Store
build
.vscode
6 changes: 3 additions & 3 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := SDL2_sound
LOCAL_MODULE := SDL3_sound

SUPPORT_MIDI ?= false


SUPPORT_MODPLUG ?= true


LOCAL_C_INCLUDES := $(LOCAL_PATH)/src
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_CFLAGS :=

LOCAL_SRC_FILES := $(LOCAL_PATH)/src/SDL_sound.c \
Expand Down Expand Up @@ -42,7 +42,7 @@ else
LOCAL_CFLAGS += -DSOUND_SUPPORTS_MODPLUG=0
endif

LOCAL_SHARED_LIBRARIES := SDL2
LOCAL_SHARED_LIBRARIES := SDL3

LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)

Expand Down
Loading

0 comments on commit ec6d222

Please sign in to comment.