Commit ba9ede12fb08361551512497c2d665a12d3c0ea2

Sam Lantinga 2018-02-13T13:25:59

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index bcc14f1..b822c7a 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -354,12 +354,14 @@ macro(CheckLibSampleRate)
   if(LIBSAMPLERATE)
     check_include_file(samplerate.h HAVE_LIBSAMPLERATE_H)
     if(HAVE_LIBSAMPLERATE_H)
+      set(HAVE_LIBSAMPLERATE TRUE)
       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}\"")
+          set(HAVE_LIBSAMPLERATE_SHARED TRUE)
         endif()
       else()
         list(APPEND EXTRA_LDFLAGS -lsamplerate)