Browse Source

Update SDL_audiolib

The latest version uses libfmt internally
and removes the need for exceptions.
pull/4775/head
Gleb Mazovetskiy 4 years ago committed by Anders Jenbo
parent
commit
d2d9fcb5b5
  1. 10
      3rdParty/SDL_audiolib/CMakeLists.txt
  2. 32
      CMake/Dependencies.cmake
  3. 2
      tools/make_src_dist.py

10
3rdParty/SDL_audiolib/CMakeLists.txt vendored

@ -6,13 +6,16 @@ else()
set(BUILD_SHARED_LIBS ON)
endif()
# Will use our `fmt::fmt` target if it exists.
set(WITH_SYSTEM_FMTLIB ON)
# No need for the libsamplerate resampler:
set(USE_RESAMP_SRC OFF)
# No need for the SOX resampler:
set(USE_RESAMP_SOXR OFF)
# We do not need any of the audio formats except WAV:
# We do not need any of the audio formats except WAV and mp3:
set(USE_DEC_DRWAV ON)
set(USE_DEC_DRFLAC OFF)
set(USE_DEC_OPENMPT OFF)
@ -22,6 +25,7 @@ set(USE_DEC_MPG123 OFF)
set(USE_DEC_SNDFILE OFF)
set(USE_DEC_LIBVORBIS OFF)
set(USE_DEC_LIBOPUSFILE OFF)
set(USE_DEC_FLAC OFF)
set(USE_DEC_MUSEPACK OFF)
set(USE_DEC_FLUIDSYNTH OFF)
set(USE_DEC_BASSMIDI OFF)
@ -31,8 +35,8 @@ set(USE_DEC_DRMP3 ON)
include(FetchContent)
FetchContent_Declare(SDL_audiolib
URL https://github.com/realnc/SDL_audiolib/archive/e503dc0200d0833da4b2dd9fa1dbf1baf02ca591.tar.gz
URL_HASH MD5=9460b91b44caa7cbb7f713214d248307)
URL https://github.com/realnc/SDL_audiolib/archive/b66a66fedf8f65cacc5ce2ff8ed8d10649c6de31.tar.gz
URL_HASH MD5=0d8909cebd83fff19cbeceebc4b4577a)
FetchContent_MakeAvailableExcludeFromAll(SDL_audiolib)
add_library(SDL_audiolib::SDL_audiolib ALIAS SDL_audiolib)

32
CMake/Dependencies.cmake

@ -117,6 +117,22 @@ else()
target_link_libraries(DevilutionX::SDL_image INTERFACE SDL2::SDL2_image)
endif()
if(NOT DEFINED DEVILUTIONX_SYSTEM_LIBFMT)
find_package(fmt 8.0.0 QUIET)
if(fmt_FOUND)
message("-- Found fmt ${fmt_VERSION}")
else()
message("-- Suitable system fmt package not found, will use fmt from source")
set(DEVILUTIONX_SYSTEM_LIBFMT OFF)
endif()
endif()
dependency_options("libfmt" DEVILUTIONX_SYSTEM_LIBFMT ON DEVILUTIONX_STATIC_LIBFMT)
if(DEVILUTIONX_SYSTEM_LIBFMT)
find_package(fmt 8.0.0 REQUIRED)
else()
add_subdirectory(3rdParty/libfmt)
endif()
if(NOT NOSOUND)
if(NOT DEFINED DEVILUTIONX_SYSTEM_SDL_AUDIOLIB)
find_package(SDL_audiolib QUIET)
@ -145,22 +161,6 @@ if(PACKET_ENCRYPTION)
endif()
endif()
if(NOT DEFINED DEVILUTIONX_SYSTEM_LIBFMT)
find_package(fmt 8.0.0 QUIET)
if(fmt_FOUND)
message("-- Found fmt ${fmt_VERSION}")
else()
message("-- Suitable system fmt package not found, will use fmt from source")
set(DEVILUTIONX_SYSTEM_LIBFMT OFF)
endif()
endif()
dependency_options("libfmt" DEVILUTIONX_SYSTEM_LIBFMT ON DEVILUTIONX_STATIC_LIBFMT)
if(DEVILUTIONX_SYSTEM_LIBFMT)
find_package(fmt 8.0.0 REQUIRED)
else()
add_subdirectory(3rdParty/libfmt)
endif()
add_subdirectory(3rdParty/libsmackerdec)
if(WIN32 AND NOT UWP_LIB)

2
tools/make_src_dist.py

@ -144,7 +144,7 @@ def ignore_dep_src(src, names):
# SDL_audiolib currently fails to compile if any of the files are missing.
# TODO: Fix this in SDL_audiolib by making this optional:
# https://github.com/realnc/SDL_audiolib/blob/5a700ba556d3a5b5c531c2fa1f45fc0c3214a16b/CMakeLists.txt#L399-L401
return []
return [name for name in names if src.endswith('/sdl_audiolib-src/3rdparty/fmt')]
if _IGNORE_DEP_DIR_RE.search(src):
_LOGGER.debug(f'Excluded directory {src}')

Loading…
Cancel
Save