update SDL_mixer to SDL3_mixer 3.2.0

This commit is contained in:
Sven Balzer
2026-04-02 16:52:07 +02:00
parent 05b19704f8
commit 8a5caf5c0d
1202 changed files with 366156 additions and 152445 deletions
@@ -0,0 +1,121 @@
# SDL3_mixer CMake configuration file:
# This file is meant to be placed in Resources/CMake of a SDL3_mixer framework
# INTERFACE_LINK_OPTIONS needs CMake 3.12
cmake_minimum_required(VERSION 3.12...4.0)
include(FeatureSummary)
set_package_properties(SDL3_mixer PROPERTIES
URL "https://www.libsdl.org/projects/SDL_mixer/"
DESCRIPTION "SDL_mixer is a sample multi-channel audio mixer library"
)
# Copied from `configure_package_config_file`
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
set(SDL3_mixer_FOUND TRUE)
set(SDLMIXER_VENDORED TRUE)
set(SDLMIXER_FLAC_LIBFLAC FALSE)
set(SDLMIXER_FLAC_DRFLAC TRUE)
set(SDLMIXER_GME TRUE)
set(SDLMIXER_MOD FALSE)
set(SDLMIXER_MOD_XMP TRUE)
set(SDLMIXER_MOD_XMP_LITE TRUE)
set(SDLMIXER_MP3 TRUE)
set(SDLMIXER_MP3_DRMP3 TRUE)
set(SDLMIXER_MP3_MPG123 FALSE)
set(SDLMIXER_MIDI TRUE)
set(SDLMIXER_MIDI_FLUIDSYNTH FALSE)
set(SDLMIXER_MIDI_TIMIDITY FALSE)
set(SDLMIXER_OPUS TRUE)
set(SDLMIXER_VORBIS STB)
set(SDLMIXER_VORBIS_STB TRUE)
set(SDLMIXER_VORBIS_TREMOR FALSE)
set(SDLMIXER_VORBIS_VORBISFILE FALSE)
set(SDLMIXER_WAVE TRUE)
# Compute the installation prefix relative to this file:
# search upwards for the .framework directory
set(_current_path "${CMAKE_CURRENT_LIST_DIR}")
get_filename_component(_current_path "${_current_path}" REALPATH)
set(_sdl3_mixer_framework_path "")
while(NOT _sdl3_mixer_framework_path)
if(IS_DIRECTORY "${_current_path}" AND "${_current_path}" MATCHES "/SDL3_mixer\\.framework$")
set(_sdl3_mixer_framework_path "${_current_path}")
break()
endif()
get_filename_component(_next_current_path "${_current_path}" DIRECTORY)
if("${_current_path}" STREQUAL "${_next_current_path}")
break()
endif()
set(_current_path "${_next_current_path}")
endwhile()
unset(_current_path)
unset(_next_current_path)
if(NOT _sdl3_mixer_framework_path)
message(FATAL_ERROR "Could not find SDL3_mixer.framework root from ${CMAKE_CURRENT_LIST_DIR}")
endif()
# All targets are created, even when some might not be requested though COMPONENTS.
# This is done for compatibility with CMake generated SDL3_mixer-target.cmake files.
if(NOT TARGET SDL3_mixer::SDL3_mixer-shared)
add_library(SDL3_mixer::SDL3_mixer-shared SHARED IMPORTED)
set_target_properties(SDL3_mixer::SDL3_mixer-shared
PROPERTIES
FRAMEWORK "TRUE"
IMPORTED_LOCATION "${_sdl3_mixer_framework_path}/SDL3_mixer"
COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED"
INTERFACE_SDL3_SHARED "ON"
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
INTERFACE_SDL_VERSION "SDL3"
)
endif()
set(SDL3_mixer_SDL3_mixer-shared_FOUND TRUE)
set(SDL3_mixer_SDL3_mixer-static FALSE)
unset(_sdl3_mixer_framework_path)
if(SDL3_mixer_SDL3_mixer-shared_FOUND)
set(SDL3_mixer_SDL3_mixer_FOUND TRUE)
endif()
function(_sdl_create_target_alias_compat NEW_TARGET TARGET)
if(CMAKE_VERSION VERSION_LESS "3.18")
# Aliasing local targets is not supported on CMake < 3.18, so make it global.
add_library(${NEW_TARGET} INTERFACE IMPORTED)
set_target_properties(${NEW_TARGET} PROPERTIES INTERFACE_LINK_LIBRARIES "${TARGET}")
else()
add_library(${NEW_TARGET} ALIAS ${TARGET})
endif()
endfunction()
# Make sure SDL3_mixer::SDL3_mixer always exists
if(NOT TARGET SDL3_mixer::SDL3_mixer)
if(TARGET SDL3_mixer::SDL3_mixer-shared)
_sdl_create_target_alias_compat(SDL3_mixer::SDL3_mixer SDL3_mixer::SDL3_mixer-shared)
endif()
endif()
check_required_components(SDL3_mixer)
@@ -0,0 +1,69 @@
# based on the files generated by CMake's write_basic_package_version_file
# This file is meant to be placed in Resources/CMake of a SDL3_mixer framework for macOS,
# or in the CMake directory of a SDL3_mixer framework for iOS / tvOS / visionOS.
cmake_minimum_required(VERSION 3.12...4.0)
# Find SDL_mixer.h.
set(_sdl_mixer_h_path "")
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/../../Headers/SDL_mixer.h")
set(_sdl_mixer_h_path "${CMAKE_CURRENT_LIST_DIR}/../../Headers/SDL_mixer.h")
elseif(EXISTS "${CMAKE_CURRENT_LIST_DIR}/../Headers/SDL_mixer.h")
set(_sdl_mixer_h_path "${CMAKE_CURRENT_LIST_DIR}/../Headers/SDL_mixer.h")
endif()
if(NOT _sdl_mixer_h_path)
message(AUTHOR_WARNING "Could not find SDL_mixer.h. This script is meant to be placed in the Resources/CMake directory or the CMake directory of SDL3_mixer.framework.")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()
file(READ "${_sdl_mixer_h_path}" _sdl_mixer_h)
string(REGEX MATCH "#define[ \t]+SDL_MIXER_MAJOR_VERSION[ \t]+([0-9]+)" _sdl_major_re "${_sdl_mixer_h}")
set(_sdl_major "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define[ \t]+SDL_MIXER_MINOR_VERSION[ \t]+([0-9]+)" _sdl_minor_re "${_sdl_mixer_h}")
set(_sdl_minor "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define[ \t]+SDL_MIXER_MICRO_VERSION[ \t]+([0-9]+)" _sdl_micro_re "${_sdl_mixer_h}")
set(_sdl_micro "${CMAKE_MATCH_1}")
if(_sdl_major_re AND _sdl_minor_re AND _sdl_micro_re)
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_micro}")
else()
message(AUTHOR_WARNING "Could not extract version from SDL_mixer.h.")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()
unset(_sdl_mixer_h)
unset(_sdl_mixer_h_path)
unset(_sdl_major_re)
unset(_sdl_major)
unset(_sdl_minor_re)
unset(_sdl_minor)
unset(_sdl_micro_re)
unset(_sdl_micro)
if(PACKAGE_FIND_VERSION_RANGE)
# Package version must be in the requested version range
if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX)
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX)))
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
endif()
else()
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
endif()
# The SDL3_mixer.xcframework only contains 64-bit archives
if(NOT "${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()