Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added configure and cmake support for libsamplerate
  • Loading branch information
slouken committed Jan 7, 2017
1 parent c5825b6 commit df25258
Show file tree
Hide file tree
Showing 7 changed files with 294 additions and 179 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Expand Up @@ -267,8 +267,6 @@ set_option(DISKAUDIO "Support the disk writer audio driver" ON)
set_option(DUMMYAUDIO "Support the dummy audio driver" ON)
set_option(VIDEO_DIRECTFB "Use DirectFB video driver" OFF)
dep_option(DIRECTFB_SHARED "Dynamically load directfb support" ON "VIDEO_DIRECTFB" OFF)
set_option(FUSIONSOUND "Use FusionSound audio driver" OFF)
dep_option(FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "FUSIONSOUND" OFF)
set_option(VIDEO_DUMMY "Use dummy video driver" ON)
set_option(VIDEO_OPENGL "Include OpenGL support" ON)
set_option(VIDEO_OPENGLES "Include OpenGL ES support" ON)
Expand All @@ -287,6 +285,10 @@ dep_option(ARTS_SHARED "Dynamically load aRts audio support" ON "ARTS" O
set_option(NAS "Support the NAS audio API" ${UNIX_SYS})
set_option(NAS_SHARED "Dynamically load NAS audio API" ${UNIX_SYS})
set_option(SNDIO "Support the sndio audio API" ${UNIX_SYS})
set_option(FUSIONSOUND "Use FusionSound audio driver" OFF)
dep_option(FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "FUSIONSOUND" OFF)
set_option(LIBSAMPLERATE "Use libsamplerate for audio rate conversion" ${UNIX_SYS})
dep_option(LIBSAMPLERATE_SHARED "Dynamically load libsamplerate" ON "LIBSAMPLERATE" OFF)
set_option(RPATH "Use an rpath when linking SDL" ${UNIX_SYS})
set_option(CLOCK_GETTIME "Use clock_gettime() instead of gettimeofday()" OFF)
set_option(INPUT_TSLIB "Use the Touchscreen library for input" ${UNIX_SYS})
Expand Down Expand Up @@ -847,6 +849,7 @@ elseif(UNIX AND NOT APPLE)
CheckNAS()
CheckSNDIO()
CheckFusionSound()
CheckLibSampleRate()
endif()

if(SDL_VIDEO)
Expand Down
23 changes: 23 additions & 0 deletions cmake/sdlchecks.cmake
Expand Up @@ -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:
Expand Down

0 comments on commit df25258

Please sign in to comment.