Added configure and cmake support for libsamplerate

This commit is contained in:
Sam Lantinga
2017-01-06 20:43:53 -08:00
parent c5825b698d
commit df25258a1e
7 changed files with 294 additions and 179 deletions

View File

@@ -315,6 +315,29 @@ macro(CheckFusionSound)
endif()
endmacro()
# Requires:
# - LIBSAMPLERATE
# Optional:
# - LIBSAMPLERATE_SHARED opt
# - HAVE_DLOPEN opt
macro(CheckLibSampleRate)
if(LIBSAMPLERATE)
check_include_file(samplerate.h HAVE_LIBSAMPLERATE_H)
if(HAVE_LIBSAMPLERATE_H)
if(LIBSAMPLERATE_SHARED)
if(NOT HAVE_DLOPEN)
message_warn("You must have SDL_LoadObject() support for dynamic libsamplerate loading")
else()
FindLibraryAndSONAME("samplerate")
set(SDL_LIBSAMPLERATE_DYNAMIC "\"${SAMPLERATE_LIB_SONAME}\"")
endif()
else()
list(APPEND EXTRA_LDFLAGS -lsamplerate)
endif()
endif()
endif()
endmacro()
# Requires:
# - n/a
# Optional: