aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-05-18 05:34:21 -0700
committerChris Robinson <[email protected]>2011-05-18 05:34:21 -0700
commit87ef4eeb368309f09de6c69698b70d1ca34b6b3b (patch)
treecab1ec1e41f22a71eab2b81308ca83f791656172
parent06f5f0b7c8bf22fe24acd2baf0cffd7a75456672 (diff)
Add cmake options to require specific backends
Note that this alone doesn't gurantee run-time availability for backends libs that are loaded at run-time.
-rw-r--r--CMakeLists.txt37
1 files changed, 37 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a46160cb..78961b09 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,6 +36,16 @@ OPTION(PULSEAUDIO "Check for PulseAudio backend" ON)
OPTION(COREAUDIO "Check for CoreAudio backend" ON)
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_MMDEVAPI "Require MMDevApi" OFF)
+OPTION(REQUIRE_DSOUND "Require DirectSound backend" OFF)
+OPTION(REQUIRE_WINMM "Require Windows Multimedia backend" OFF)
+OPTION(REQUIRE_PORTAUDIO "Require PortAudio backend" OFF)
+OPTION(REQUIRE_PULSEAUDIO "Require PulseAudio backend" OFF)
+OPTION(REQUIRE_COREAUDIO "Require CoreAudio backend" OFF)
+
OPTION(DLOPEN "Check for the dlopen API for loading optional libs" ON)
OPTION(WERROR "Treat compile warnings as errors" OFF)
@@ -385,6 +395,9 @@ IF(ALSA)
ENDIF()
ENDIF()
ENDIF()
+IF(REQUIRE_ALSA AND NOT HAVE_ALSA)
+ MESSAGE(FATAL_ERROR "Failed to enabled required ALSA backend")
+ENDIF()
# Check OSS backend
IF(OSS)
@@ -395,6 +408,9 @@ IF(OSS)
SET(BACKENDS "${BACKENDS} OSS,")
ENDIF()
ENDIF()
+IF(REQUIRE_OSS AND NOT HAVE_OSS)
+ MESSAGE(FATAL_ERROR "Failed to enabled required OSS backend")
+ENDIF()
# Check Solaris backend
IF(SOLARIS)
@@ -405,6 +421,9 @@ IF(SOLARIS)
SET(BACKENDS "${BACKENDS} Solaris,")
ENDIF()
ENDIF()
+IF(REQUIRE_SOLARIS AND NOT HAVE_SOLARIS)
+ MESSAGE(FATAL_ERROR "Failed to enabled required Solaris backend")
+ENDIF()
# Check for MMDevApi backend
IF(HAVE_WINDOWS_H)
@@ -418,6 +437,9 @@ IF(HAVE_WINDOWS_H)
ENDIF()
ENDIF()
ENDIF()
+IF(REQUIRE_MMDEVAPI AND NOT HAVE_MMDEVAPI)
+ MESSAGE(FATAL_ERROR "Failed to enabled required MMDevApi backend")
+ENDIF()
# Check DSound/MMSystem backend
IF(DSOUND)
@@ -437,6 +459,9 @@ IF(DSOUND)
ENDIF()
ENDIF()
ENDIF()
+IF(REQUIRE_DSOUND AND NOT HAVE_DSOUND)
+ MESSAGE(FATAL_ERROR "Failed to enabled required DSound backend")
+ENDIF()
IF(HAVE_WINDOWS_H)
IF(WINMM)
@@ -448,6 +473,9 @@ IF(HAVE_WINDOWS_H)
ENDIF()
ENDIF()
ENDIF()
+IF(REQUIRE_WINMM AND NOT HAVE_WINMM)
+ MESSAGE(FATAL_ERROR "Failed to enabled required WinMM backend")
+ENDIF()
# Check PortAudio backend
IF(PORTAUDIO)
@@ -466,6 +494,9 @@ IF(PORTAUDIO)
ENDIF()
ENDIF()
ENDIF()
+IF(REQUIRE_PORTAUDIO AND NOT HAVE_PORTAUDIO)
+ MESSAGE(FATAL_ERROR "Failed to enabled required PortAudio backend")
+ENDIF()
# Check PortAudio backend
IF(PULSEAUDIO)
@@ -484,6 +515,9 @@ IF(PULSEAUDIO)
ENDIF()
ENDIF()
ENDIF()
+IF(REQUIRE_PULSEAUDIO AND NOT HAVE_PULSEAUDIO)
+ MESSAGE(FATAL_ERROR "Failed to enabled required PulseAudio backend")
+ENDIF()
# Check CoreAudio backend
IF(COREAUDIO)
@@ -497,6 +531,9 @@ IF(COREAUDIO)
SET(EXTRA_LIBS /System/Library/Frameworks/ApplicationServices.framework ${EXTRA_LIBS})
ENDIF()
ENDIF()
+IF(REQUIRE_COREAUDIO AND NOT HAVE_COREAUDIO)
+ MESSAGE(FATAL_ERROR "Failed to enabled required CoreAudio backend")
+ENDIF()
# Optionally enable the Wave Writer backend
IF(WAVE)