Skip to content

Commit

Permalink
cmake: rename 'SDL3MIXER_' prefix to 'SDLMIXER_'
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr committed Aug 15, 2024
1 parent 518311a commit e2cdd80
Show file tree
Hide file tree
Showing 9 changed files with 423 additions and 423 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
fail-fast: false
matrix:
platform:
- { name: Windows (MSVC), os: windows-2019, shell: sh, cmake: '-DPerl_ROOT=C:/Strawberry/perl/bin/ -DSDL3MIXER_VENDORED=ON -GNinja', msvc: 1, shared: 1, static: 0 }
- { name: Windows (MSVC), os: windows-2019, shell: sh, cmake: '-DPerl_ROOT=C:/Strawberry/perl/bin/ -DSDLMIXER_VENDORED=ON -GNinja', msvc: 1, shared: 1, static: 0 }
- { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64, shared: 1, static: 0,
cmake: '-DSDL3MIXER_VENDORED=OFF -G "Ninja Multi-Config"' }
- { name: Linux, os: ubuntu-20.04, shell: sh, cmake: '-DSDL3MIXER_VENDORED=ON -GNinja', shared: 1, static: 0 }
- { name: 'Linux (static)', os: ubuntu-20.04, shell: sh, cmake: '-DSDL3MIXER_VENDORED=ON -DBUILD_SHARED_LIBS=OFF -GNinja', shared: 0, static: 1 }
- { name: Macos, os: macos-latest, shell: sh, cmake: '-DSDL3MIXER_VENDORED=ON -GNinja', shared: 1, static: 0 }
cmake: '-DSDLMIXER_VENDORED=OFF -G "Ninja Multi-Config"' }
- { name: Linux, os: ubuntu-20.04, shell: sh, cmake: '-DSDLMIXER_VENDORED=ON -GNinja', shared: 1, static: 0 }
- { name: 'Linux (static)', os: ubuntu-20.04, shell: sh, cmake: '-DSDLMIXER_VENDORED=ON -DBUILD_SHARED_LIBS=OFF -GNinja', shared: 0, static: 1 }
- { name: Macos, os: macos-latest, shell: sh, cmake: '-DSDLMIXER_VENDORED=ON -GNinja', shared: 1, static: 0 }


steps:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
ninja-build \
pkg-config \
${NULL+}
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -112,16 +112,16 @@ jobs:
set -- \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DSDL3MIXER_FLAC=ON \
-DSDL3MIXER_FLAC_LIBFLAC=ON \
-DSDL3MIXER_GME=ON \
-DSDL3MIXER_MOD_XMP=ON \
-DSDL3MIXER_MP3_MPG123=ON \
-DSDL3MIXER_OPUS=ON \
-DSDL3MIXER_VORBIS=VORBISFILE \
-DSDL3MIXER_STRICT=ON \
-DSDL3MIXER_WERROR=ON \
-DSDL3MIXER_INSTALL_MAN=ON \
-DSDLMIXER_FLAC=ON \
-DSDLMIXER_FLAC_LIBFLAC=ON \
-DSDLMIXER_GME=ON \
-DSDLMIXER_MOD_XMP=ON \
-DSDLMIXER_MP3_MPG123=ON \
-DSDLMIXER_OPUS=ON \
-DSDLMIXER_VORBIS=VORBISFILE \
-DSDLMIXER_STRICT=ON \
-DSDLMIXER_WERROR=ON \
-DSDLMIXER_INSTALL_MAN=ON \
-DCMAKE_INSTALL_PREFIX=prefix_cmake \
${NULL+}
Expand Down
612 changes: 306 additions & 306 deletions CMakeLists.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This library is under the zlib license, see the file "LICENSE.txt" for details.

Note:
Support for software MIDI, MOD, and Opus are not included by default because of the size of the decode libraries, but you can get them by running external/download.sh
- When building with CMake, you can enable the appropriate SDL3MIXER_* options defined in CMakeLists.txt. SDL3MIXER_VENDORED allows switching between system and vendored libraries.
- When building with CMake, you can enable the appropriate SDLMIXER_* options defined in CMakeLists.txt. SDLMIXER_VENDORED allows switching between system and vendored libraries.
- When building with configure/make, you can build and install them normally and the configure script will detect and use them.
- When building with Visual Studio, you will need to build the libraries and then add the appropriate LOAD_* preprocessor define to the Visual Studio project.
- When building with Xcode, you can edit the config at the top of the project to enable them, and you will need to include the appropriate framework in your application.
Expand Down
44 changes: 22 additions & 22 deletions VisualC/pkg-support/cmake/sdl3_mixer-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,37 @@ cmake_minimum_required(VERSION 3.0)

set(SDL3_mixer_FOUND TRUE)

set(SDL3MIXER_VENDORED TRUE)
set(SDLMIXER_VENDORED TRUE)

set(SDL3MIXER_CMD FALSE)
set(SDLMIXER_CMD FALSE)

set(SDL3MIXER_FLAC_LIBFLAC FALSE)
set(SDL3MIXER_FLAC_DRFLAC TRUE)
set(SDLMIXER_FLAC_LIBFLAC FALSE)
set(SDLMIXER_FLAC_DRFLAC TRUE)

set(SDL3MIXER_GME FALSE)
set(SDLMIXER_GME FALSE)

set(SDL3MIXER_MOD TRUE)
set(SDL3MIXER_MOD_MODPLUG TRUE)
set(SDL3MIXER_MOD_XMP FALSE)
set(SDL3MIXER_MOD_XMP_LITE FALSE)
set(SDLMIXER_MOD TRUE)
set(SDLMIXER_MOD_MODPLUG TRUE)
set(SDLMIXER_MOD_XMP FALSE)
set(SDLMIXER_MOD_XMP_LITE FALSE)

set(SDL3MIXER_MP3 TRUE)
set(SDL3MIXER_MP3_DRMP3 TRUE)
set(SDL3MIXER_MP3_MPG123 FALSE)
set(SDLMIXER_MP3 TRUE)
set(SDLMIXER_MP3_DRMP3 TRUE)
set(SDLMIXER_MP3_MPG123 FALSE)

set(SDL3MIXER_MIDI TRUE)
set(SDL3MIXER_MIDI_FLUIDSYNTH FALSE)
set(SDL3MIXER_MIDI_NATIVE TRUE)
set(SDL3MIXER_MIDI_TIMIDITY TRUE)
set(SDLMIXER_MIDI TRUE)
set(SDLMIXER_MIDI_FLUIDSYNTH FALSE)
set(SDLMIXER_MIDI_NATIVE TRUE)
set(SDLMIXER_MIDI_TIMIDITY TRUE)

set(SDL3MIXER_OPUS TRUE)
set(SDLMIXER_OPUS TRUE)

set(SDL3MIXER_VORBIS STB)
set(SDL3MIXER_VORBIS_STB TRUE)
set(SDL3MIXER_VORBIS_TREMOR FALSE)
set(SDL3MIXER_VORBIS_VORBISFILE FALSE)
set(SDLMIXER_VORBIS STB)
set(SDLMIXER_VORBIS_STB TRUE)
set(SDLMIXER_VORBIS_TREMOR FALSE)
set(SDLMIXER_VORBIS_VORBISFILE FALSE)

set(SDL3MIXER_WAVE TRUE)
set(SDLMIXER_WAVE TRUE)

if(CMAKE_SIZEOF_VOID_P STREQUAL "4")
set(_sdl_arch_subdir "x86")
Expand Down
44 changes: 22 additions & 22 deletions Xcode/pkg-support/resources/CMake/sdl3_mixer-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,37 @@ set_package_properties(SDL3_mixer PROPERTIES

set(SDL3_mixer_FOUND TRUE)

set(SDL3MIXER_VENDORED TRUE)
set(SDLMIXER_VENDORED TRUE)

set(SDL3MIXER_CMD FALSE)
set(SDLMIXER_CMD FALSE)

set(SDL3MIXER_FLAC_LIBFLAC FALSE)
set(SDL3MIXER_FLAC_DRFLAC TRUE)
set(SDLMIXER_FLAC_LIBFLAC FALSE)
set(SDLMIXER_FLAC_DRFLAC TRUE)

set(SDL3MIXER_GME FALSE)
set(SDLMIXER_GME FALSE)

set(SDL3MIXER_MOD FALSE)
set(SDL3MIXER_MOD_MODPLUG FALSE)
set(SDL3MIXER_MOD_XMP FALSE)
set(SDL3MIXER_MOD_XMP_LITE FALSE)
set(SDLMIXER_MOD FALSE)
set(SDLMIXER_MOD_MODPLUG FALSE)
set(SDLMIXER_MOD_XMP FALSE)
set(SDLMIXER_MOD_XMP_LITE FALSE)

set(SDL3MIXER_MP3 TRUE)
set(SDL3MIXER_MP3_DRMP3 TRUE)
set(SDL3MIXER_MP3_MPG123 FALSE)
set(SDLMIXER_MP3 TRUE)
set(SDLMIXER_MP3_DRMP3 TRUE)
set(SDLMIXER_MP3_MPG123 FALSE)

set(SDL3MIXER_MIDI FALSE)
set(SDL3MIXER_MIDI_FLUIDSYNTH FALSE)
set(SDL3MIXER_MIDI_NATIVE FALSE)
set(SDL3MIXER_MIDI_TIMIDITY FALSE)
set(SDLMIXER_MIDI FALSE)
set(SDLMIXER_MIDI_FLUIDSYNTH FALSE)
set(SDLMIXER_MIDI_NATIVE FALSE)
set(SDLMIXER_MIDI_TIMIDITY FALSE)

set(SDL3MIXER_OPUS FALSE)
set(SDLMIXER_OPUS FALSE)

set(SDL3MIXER_VORBIS STB)
set(SDL3MIXER_VORBIS_STB TRUE)
set(SDL3MIXER_VORBIS_TREMOR FALSE)
set(SDL3MIXER_VORBIS_VORBISFILE FALSE)
set(SDLMIXER_VORBIS STB)
set(SDLMIXER_VORBIS_STB TRUE)
set(SDLMIXER_VORBIS_TREMOR FALSE)
set(SDLMIXER_VORBIS_VORBISFILE FALSE)

set(SDL3MIXER_WAVE TRUE)
set(SDLMIXER_WAVE TRUE)

string(REGEX REPLACE "SDL3_mixer\\.framework.*" "SDL3_mixer.framework" _sdl3mixer_framework_path "${CMAKE_CURRENT_LIST_DIR}")
string(REGEX REPLACE "SDL3_mixer\\.framework.*" "" _sdl3mixer_framework_parent_path "${CMAKE_CURRENT_LIST_DIR}")
Expand Down
28 changes: 14 additions & 14 deletions build-scripts/android-prefab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,21 @@ build_cmake_projects() {
for build_shared_libs in ON OFF; do
echo "Configuring CMake project for $android_abi (shared=${build_shared_libs})"
cmake -S "${sdlmixer_root}" -B "${build_root}/build_${android_abi}/shared_${build_shared_libs}" \
-DSDL3MIXER_DEPS_SHARED=ON \
-DSDL3MIXER_VENDORED=ON \
-DSDL3MIXER_FLAC=ON \
-DSDLMIXER_DEPS_SHARED=ON \
-DSDLMIXER_VENDORED=ON \
-DSDLMIXER_FLAC=ON \
-DWITH_ASM=OFF \
-DSDL3MIXER_FLAC_LIBFLAC=ON \
-DSDL3MIXER_MOD=ON \
-DSDL3MIXER_MOD_MODPLUG=OFF \
-DSDL3MIXER_MOD_XMP=ON \
-DSDL3MIXER_MP3=ON \
-DSDL3MIXER_MP3_MPG123=ON \
-DSDL3MIXER_MIDI=ON \
-DSDL3MIXER_MIDI_TIMIDITY=ON \
-DSDL3MIXER_OPUS=ON \
-DSDL3MIXER_VORBIS=STB \
-DSDL3MIXER_WAVPACK=ON \
-DSDLMIXER_FLAC_LIBFLAC=ON \
-DSDLMIXER_MOD=ON \
-DSDLMIXER_MOD_MODPLUG=OFF \
-DSDLMIXER_MOD_XMP=ON \
-DSDLMIXER_MP3=ON \
-DSDLMIXER_MP3_MPG123=ON \
-DSDLMIXER_MIDI=ON \
-DSDLMIXER_MIDI_TIMIDITY=ON \
-DSDLMIXER_OPUS=ON \
-DSDLMIXER_VORBIS=STB \
-DSDLMIXER_WAVPACK=ON \
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake" \
-DSDL${sdlmixer_major}_DIR="${sdl_build_root}/build_${android_abi}/prefix/lib/cmake/SDL${sdlmixer_major}" \
-DANDROID_PLATFORM=${ANDROID_PLATFORM} \
Expand Down
80 changes: 40 additions & 40 deletions cmake/SDL3_mixerConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,53 +10,53 @@ set_package_properties(SDL3_mixer PROPERTIES

set(SDL3_mixer_FOUND ON)

set(SDL3MIXER_VENDORED @SDL3MIXER_VENDORED@)
set(SDLMIXER_VENDORED @SDLMIXER_VENDORED@)

set(SDL3MIXER_CMD @SDL3MIXER_CMD_ENABLED@)
set(SDLMIXER_CMD @SDLMIXER_CMD_ENABLED@)

set(SDL3MIXER_SNDFILE @SDL3MIXER_SNDFILE_ENABLED@)
set(SDLMIXER_SNDFILE @SDLMIXER_SNDFILE_ENABLED@)

set(SDL3MIXER_FLAC @SDL3MIXER_FLAC_ENABLED@)
set(SDL3MIXER_FLAC_LIBFLAC @SDL3MIXER_FLAC_LIBFLAC_ENABLED@)
set(SDL3MIXER_FLAC_DRFLAC @SDL3MIXER_FLAC_DRFLAC_ENABLED@)
set(SDLMIXER_FLAC @SDLMIXER_FLAC_ENABLED@)
set(SDLMIXER_FLAC_LIBFLAC @SDLMIXER_FLAC_LIBFLAC_ENABLED@)
set(SDLMIXER_FLAC_DRFLAC @SDLMIXER_FLAC_DRFLAC_ENABLED@)

set(SDL3MIXER_GME @SDL3MIXER_GME_ENABLED@)
set(SDLMIXER_GME @SDLMIXER_GME_ENABLED@)

set(SDL3MIXER_MOD @SDL3MIXER_MOD_ENABLED@)
set(SDL3MIXER_MOD_MODPLUG @SDL3MIXER_MOD_MODPLUG_ENABLED@)
set(SDL3MIXER_MOD_XMP @SDL3MIXER_MOD_XMP_ENABLED@)
set(SDL3MIXER_MOD_XMP_LITE @SDL3MIXER_MOD_XMP_ENABLED@)
set(SDLMIXER_MOD @SDLMIXER_MOD_ENABLED@)
set(SDLMIXER_MOD_MODPLUG @SDLMIXER_MOD_MODPLUG_ENABLED@)
set(SDLMIXER_MOD_XMP @SDLMIXER_MOD_XMP_ENABLED@)
set(SDLMIXER_MOD_XMP_LITE @SDLMIXER_MOD_XMP_ENABLED@)

set(SDL3MIXER_MP3 @SDL3MIXER_MP3_ENABLED@)
set(SDL3MIXER_MP3_DRMP3 @SDL3MIXER_MP3_DRMP3_ENABLED@)
set(SDL3MIXER_MP3_MPG123 @SDL3MIXER_MP3_MPG123_ENABLED@)
set(SDLMIXER_MP3 @SDLMIXER_MP3_ENABLED@)
set(SDLMIXER_MP3_DRMP3 @SDLMIXER_MP3_DRMP3_ENABLED@)
set(SDLMIXER_MP3_MPG123 @SDLMIXER_MP3_MPG123_ENABLED@)

set(SDL3MIXER_MIDI @SDL3MIXER_MIDI_ENABLED@)
set(SDL3MIXER_MIDI_FLUIDSYNTH @SDL3MIXER_MIDI_FLUIDSYNTH_ENABLED@)
set(SDL3MIXER_MIDI_NATIVE @SDL3MIXER_MIDI_NATIVE_ENABLED@)
set(SDL3MIXER_MIDI_TIMIDITY @SDL3MIXER_MIDI_TIMIDITY_ENABLED@)
set(SDLMIXER_MIDI @SDLMIXER_MIDI_ENABLED@)
set(SDLMIXER_MIDI_FLUIDSYNTH @SDLMIXER_MIDI_FLUIDSYNTH_ENABLED@)
set(SDLMIXER_MIDI_NATIVE @SDLMIXER_MIDI_NATIVE_ENABLED@)
set(SDLMIXER_MIDI_TIMIDITY @SDLMIXER_MIDI_TIMIDITY_ENABLED@)

set(SDL3MIXER_OPUS @SDL3MIXER_OPUS_ENABLED@)
set(SDLMIXER_OPUS @SDLMIXER_OPUS_ENABLED@)

set(SDL3MIXER_VORBIS @SDL3MIXER_VORBIS_ENABLED@)
set(SDL3MIXER_VORBIS_STB @SDL3MIXER_VORBIS_STB_ENABLED@)
set(SDL3MIXER_VORBIS_TREMOR @SDL3MIXER_VORBIS_TREMOR_ENABLED@)
set(SDL3MIXER_VORBIS_VORBISFILE @SDL3MIXER_VORBIS_VORBISFILE_ENABLED@)
set(SDLMIXER_VORBIS @SDLMIXER_VORBIS_ENABLED@)
set(SDLMIXER_VORBIS_STB @SDLMIXER_VORBIS_STB_ENABLED@)
set(SDLMIXER_VORBIS_TREMOR @SDLMIXER_VORBIS_TREMOR_ENABLED@)
set(SDLMIXER_VORBIS_VORBISFILE @SDLMIXER_VORBIS_VORBISFILE_ENABLED@)

set(SDL3MIXER_WAVE @SDL3MIXER_WAVE_ENABLED@)
set(SDLMIXER_WAVE @SDLMIXER_WAVE_ENABLED@)

set(SDL3MIXER_WAVPACK @SDL3MIXER_WAVPACK_ENABLED@)
set(SDLMIXER_WAVPACK @SDLMIXER_WAVPACK_ENABLED@)

set(SDL3MIXER_SDL3_REQUIRED_VERSION @SDL_REQUIRED_VERSION@)
set(SDLMIXER_SDL3_REQUIRED_VERSION @SDL_REQUIRED_VERSION@)

if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3_mixer-shared-targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SDL3_mixer-shared-targets.cmake")
endif()

if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3_mixer-static-targets.cmake")

if(SDL3MIXER_VENDORED)
if(SDL3MIXER_GME)
if(SDLMIXER_VENDORED)
if(SDLMIXER_GME)
include(CheckLanguage)
check_language(CXX)
if(NOT CMAKE_CXX_COMPILER)
Expand All @@ -74,54 +74,54 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3_mixer-static-targets.cmake")
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
endif()

if(SDL3MIXER_SNDFILE AND NOT TARGET SndFile::sndfile)
if(SDLMIXER_SNDFILE AND NOT TARGET SndFile::sndfile)
find_dependency(SndFile)
endif()

if(SDL3MIXER_FLAC_LIBFLAC AND NOT TARGET FLAC::FLAC)
if(SDLMIXER_FLAC_LIBFLAC AND NOT TARGET FLAC::FLAC)
find_dependency(FLAC)
endif()

if(SDL3MIXER_MOD_MODPLUG AND NOT TARGET modplug::modplug)
if(SDLMIXER_MOD_MODPLUG AND NOT TARGET modplug::modplug)
find_dependency(modplug)
endif()

if(SDL3MIXER_MOD_XMP AND NOT TARGET libxmp::libxmp)
if(SDLMIXER_MOD_XMP AND NOT TARGET libxmp::libxmp)
find_dependency(libxmp)
endif()

if(SDL3MIXER_MOD_XMP_LITE AND NOT TARGET libxmp-lite::libxmp-lite)
if(SDLMIXER_MOD_XMP_LITE AND NOT TARGET libxmp-lite::libxmp-lite)
find_dependency(libxmp-lite)
endif()

if(SDL3MIXER_MP3_MPG123 AND NOT TARGET MPG123::mpg123)
if(SDLMIXER_MP3_MPG123 AND NOT TARGET MPG123::mpg123)
find_dependency(mpg123)
endif()

if(SDL3MIXER_MIDI_FLUIDSYNTH AND NOT TARGET FluidSynth::libfluidsynth)
if(SDLMIXER_MIDI_FLUIDSYNTH AND NOT TARGET FluidSynth::libfluidsynth)
find_dependency(FluidSynth)
endif()

if(SDL3MIXER_VORBIS_TREMOR AND NOT TARGET tremor::tremor)
if(SDLMIXER_VORBIS_TREMOR AND NOT TARGET tremor::tremor)
find_dependency(tremor)
endif()

if(SDL3MIXER_VORBIS_VORBISFILE AND NOT TARGET Vorbis::vorbisfile)
if(SDLMIXER_VORBIS_VORBISFILE AND NOT TARGET Vorbis::vorbisfile)
find_dependency(Vorbis)
endif()

if(SDL3MIXER_OPUS AND NOT TARGET OpusFile::opusfile)
if(SDLMIXER_OPUS AND NOT TARGET OpusFile::opusfile)
find_dependency(OpusFile)
endif()

if(SDL3MIXER_WAVPACK AND NOT TARGET WavPack::WavPack)
if(SDLMIXER_WAVPACK AND NOT TARGET WavPack::WavPack)
find_dependency(wavpack)
endif()

set(CMAKE_MODULE_PATH "${_sdl_cmake_module_path}")
unset(_sdl_cmake_module_path)

if(HAIKU AND SDL3MIXER_MIDI_NATIVE)
if(HAIKU AND SDLMIXER_MIDI_NATIVE)
include(CheckLanguage)
check_language(CXX)
if(NOT CMAKE_CXX_COMPILER)
Expand Down
2 changes: 1 addition & 1 deletion external/libgme
2 changes: 1 addition & 1 deletion mingw/pkg-support/cmake/sdl3_mixer-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ endif()
include("${sdl3_mixer_config_path}")

# The SDL_mixer MinGW development package ships with vendored libraries
set(SDL3MIXER_VENDORED 1)
set(SDLMIXER_VENDORED 1)

0 comments on commit e2cdd80

Please sign in to comment.