Fixed bug 4027 - CheckLibSampleRate macro in sdlchecks.cmake never defines HAVE_LIBSAMPLERATE{,_SHARED}, so they're always reported as disabled by MESSAGE_TESTED_OPTION macro in macros.cmake

This commit is contained in:
Sam Lantinga 2018-02-13 13:25:59 -08:00
parent f6366c09e2
commit ba9ede12fb

View File

@ -354,12 +354,14 @@ macro(CheckLibSampleRate)
if(LIBSAMPLERATE) if(LIBSAMPLERATE)
check_include_file(samplerate.h HAVE_LIBSAMPLERATE_H) check_include_file(samplerate.h HAVE_LIBSAMPLERATE_H)
if(HAVE_LIBSAMPLERATE_H) if(HAVE_LIBSAMPLERATE_H)
set(HAVE_LIBSAMPLERATE TRUE)
if(LIBSAMPLERATE_SHARED) if(LIBSAMPLERATE_SHARED)
if(NOT HAVE_DLOPEN) if(NOT HAVE_DLOPEN)
message_warn("You must have SDL_LoadObject() support for dynamic libsamplerate loading") message_warn("You must have SDL_LoadObject() support for dynamic libsamplerate loading")
else() else()
FindLibraryAndSONAME("samplerate") FindLibraryAndSONAME("samplerate")
set(SDL_LIBSAMPLERATE_DYNAMIC "\"${SAMPLERATE_LIB_SONAME}\"") set(SDL_LIBSAMPLERATE_DYNAMIC "\"${SAMPLERATE_LIB_SONAME}\"")
set(HAVE_LIBSAMPLERATE_SHARED TRUE)
endif() endif()
else() else()
list(APPEND EXTRA_LDFLAGS -lsamplerate) list(APPEND EXTRA_LDFLAGS -lsamplerate)