aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eaa978c6..3ba44cd8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,7 @@ SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
OPTION(ALSA "Check for ALSA backend" ON)
OPTION(OSS "Check for OSS backend" ON)
OPTION(SOLARIS "Check for Solaris backend" ON)
+OPTION(SNDIO "Check for SndIO backend" ON)
OPTION(MMDEVAPI "Check for MMDevApi" ON)
OPTION(DSOUND "Check for DirectSound backend" ON)
OPTION(WINMM "Check for Windows Multimedia backend" ON)
@@ -40,6 +41,7 @@ OPTION(WAVE "Enable Wave Writer backend" ON)
OPTION(REQUIRE_ALSA "Require ALSA backend" OFF)
OPTION(REQUIRE_OSS "Require OSS backend" OFF)
OPTION(REQUIRE_SOLARIS "Require Solaris backend" OFF)
+OPTION(REQUIRE_SNDIO "Require SndIO backend" OFF)
OPTION(REQUIRE_MMDEVAPI "Require MMDevApi" OFF)
OPTION(REQUIRE_DSOUND "Require DirectSound backend" OFF)
OPTION(REQUIRE_WINMM "Require Windows Multimedia backend" OFF)
@@ -431,6 +433,27 @@ IF(REQUIRE_SOLARIS AND NOT HAVE_SOLARIS)
MESSAGE(FATAL_ERROR "Failed to enabled required Solaris backend")
ENDIF()
+# Check SndIO backend
+IF(SNDIO)
+ CHECK_INCLUDE_FILE(sndio.h HAVE_SNDIO_H)
+ IF(HAVE_SNDIO_H)
+ CHECK_SHARED_LIBRARY_EXISTS(sndio sio_open 3 "" HAVE_LIBSNDIO)
+ IF(HAVE_LIBSNDIO OR HAVE_DLFCN_H OR WIN32)
+ SET(HAVE_SNDIO 1)
+ SET(ALC_OBJS ${ALC_OBJS} Alc/sndio.c)
+ IF(HAVE_DLFCN_H OR WIN32)
+ SET(BACKENDS "${BACKENDS} SndIO,")
+ ELSE()
+ SET(BACKENDS "${BACKENDS} SndIO \(linked\),")
+ SET(EXTRA_LIBS sndio ${EXTRA_LIBS})
+ ENDIF()
+ ENDIF()
+ ENDIF()
+ENDIF()
+IF(REQUIRE_SNDIO AND NOT HAVE_SNDIO)
+ MESSAGE(FATAL_ERROR "Failed to enabled required SndIO backend")
+ENDIF()
+
# Check for MMDevApi backend
IF(HAVE_WINDOWS_H)
IF(MMDEVAPI)