From 4382f86c4fafe18e2ce15f7cbadabb5b8149886d Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Thu, 12 Mar 2026 11:46:31 +0100 Subject: [PATCH] Add SDL-mixer dependency --- CMakeLists.txt | 4 +++- cmake/SDL-mixer.cmake | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 cmake/SDL-mixer.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 9395f83759..f4bfc954f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,7 +62,9 @@ FetchContent_Declare( FetchContent_MakeAvailable(cxxopts) +message(STATUS "Dusk: Fetching SDL3-mixer") +include(cmake/SDL-mixer.cmake) include(files.cmake) # TODO: version handling for res includes @@ -94,7 +96,7 @@ target_include_directories(game_debug PUBLIC extern ${CMAKE_SOURCE_DIR}/build/${DUSK_TP_VERSION}/include build/${DUSK_TP_VERSION}/include) -target_link_libraries(game_debug PUBLIC aurora::core aurora::gx aurora::gd aurora::si aurora::vi aurora::pad aurora::mtx aurora::os aurora::dvd aurora::card) +target_link_libraries(game_debug PUBLIC aurora::core aurora::gx aurora::gd aurora::si aurora::vi aurora::pad aurora::mtx aurora::os aurora::dvd aurora::card SDL3_mixer::SDL3_mixer) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) add_library(game SHARED ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${SSYSTEM_FILES} ${JSYSTEM_FILES} ${REL_FILES} ${DUSK_FILES} ${DOLPHIN_FILES} diff --git a/cmake/SDL-mixer.cmake b/cmake/SDL-mixer.cmake new file mode 100644 index 0000000000..e2106c4eb6 --- /dev/null +++ b/cmake/SDL-mixer.cmake @@ -0,0 +1,28 @@ +set(SDLMIXER_VENDORED ON) +set(SDLMIXER_STRICT ON) +set(BUILD_SHARED_LIBS OFF) + +set(SDLMIXER_AIFF OFF) +set(SDLMIXER_WAVE OFF) +set(SDLMIXER_VOC OFF) +set(SDLMIXER_AU OFF) +set(SDLMIXER_FLAC OFF) +set(SDLMIXER_GME OFF) +set(SDLMIXER_MOD OFF) +set(SDLMIXER_MP3 OFF) +set(SDLMIXER_MIDI OFF) +set(SDLMIXER_OPUS OFF) +set(SDLMIXER_WAVPACK OFF) +set(SDLMIXER_VORBIS_STB OFF) +set(SDLMIXER_VORBIS_VORBISFILE OFF) + +FetchContent_Declare(SDL-mixer + URL https://github.com/libsdl-org/SDL_mixer/archive/refs/tags/release-3.2.0.tar.gz + URL_HASH SHA256=1077fef4a6e9513027da0a08e6f1b8645f8c88c8bef001c17befeb52b129b5dd + DOWNLOAD_EXTRACT_TIMESTAMP TRUE +) + +FetchContent_MakeAvailable(SDL-mixer) +if (NOT TARGET SDL3_mixer::SDL3_mixer) + message(FATAL_ERROR "Failed to make SDL-mixer available") +endif ()