cmake/sdlchecks.cmake
changeset 7367 d6eabafa8776
parent 7266 6caad66a4966
child 7400 243dad4e5f29
equal deleted inserted replaced
7366:38c6f26bb010 7367:d6eabafa8776
   222       endif(NAS_SHARED)
   222       endif(NAS_SHARED)
   223       set(HAVE_SDL_AUDIO TRUE)
   223       set(HAVE_SDL_AUDIO TRUE)
   224     endif(HAVE_NAS_H AND D_NAS_LIB)
   224     endif(HAVE_NAS_H AND D_NAS_LIB)
   225   endif(NAS)
   225   endif(NAS)
   226 endmacro(CheckNAS)
   226 endmacro(CheckNAS)
       
   227 
       
   228 # Requires:
       
   229 # - n/a
       
   230 # Optional:
       
   231 # - SNDIO_SHARED opt
       
   232 # - HAVE_DLOPEN opt
       
   233 macro(CheckSNDIO)
       
   234   if(SNDIO)
       
   235     # TODO: set include paths properly, so the sndio headers are found
       
   236     check_include_file(sndio.h HAVE_SNDIO_H)
       
   237     find_library(D_SNDIO_LIB audio)
       
   238     if(HAVE_SNDIO_H AND D_SNDIO_LIB)
       
   239       set(HAVE_SNDIO TRUE)
       
   240       file(GLOB SNDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sndio/*.c)
       
   241       set(SOURCE_FILES ${SOURCE_FILES} ${SNDIO_SOURCES})
       
   242       set(SDL_AUDIO_DRIVER_SNDIO 1)
       
   243       if(SNDIO_SHARED)
       
   244         if(NOT HAVE_DLOPEN)
       
   245           message_warn("You must have SDL_LoadObject() support for dynamic sndio loading")
       
   246         else()
       
   247           get_filename_component(F_SNDIO_LIB ${D_SNDIO_LIB} NAME)
       
   248           set(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC "\"${F_SNDIO_LIB}\"")
       
   249           set(HAVE_SNDIO_SHARED TRUE)
       
   250         endif(NOT HAVE_DLOPEN)
       
   251       else(SNDIO_SHARED)
       
   252         list(APPEND EXTRA_LIBS ${D_SNDIO_LIB})
       
   253       endif(SNDIO_SHARED)
       
   254       set(HAVE_SDL_AUDIO TRUE)
       
   255     endif(HAVE_SNDIO_H AND D_SNDIO_LIB)
       
   256   endif(SNDIO)
       
   257 endmacro(CheckSNDIO)
   227 
   258 
   228 # Requires:
   259 # Requires:
   229 # - PkgCheckModules
   260 # - PkgCheckModules
   230 # Optional:
   261 # Optional:
   231 # - FUSIONSOUND_SHARED opt
   262 # - FUSIONSOUND_SHARED opt