aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-08-11 09:13:08 -0700
committerChris Robinson <[email protected]>2014-08-11 09:13:08 -0700
commit8ecbeb4945441ed4d797905ee1c609c163dcd51b (patch)
tree7a3601db048807292fe9e4afcb3a3dcf49cbf239
parent960cdec0b595718e7c1d52982778b8360f42db17 (diff)
Only support dsound and mmdevapi on Windows
-rw-r--r--CMakeLists.txt71
1 files changed, 35 insertions, 36 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 93732fc2..1b1fc772 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -810,45 +810,12 @@ IF(ALSOFT_REQUIRE_QSA AND NOT HAVE_QSA)
MESSAGE(FATAL_ERROR "Failed to enabled required QSA backend")
ENDIF()
-# Check DSound backend
+# Check Windows-only backends
+OPTION(ALSOFT_REQUIRE_WINMM "Require Windows Multimedia backend" OFF)
OPTION(ALSOFT_REQUIRE_DSOUND "Require DirectSound backend" OFF)
-FIND_PACKAGE(DSound)
-IF(DSOUND_FOUND)
- OPTION(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON)
- IF(ALSOFT_BACKEND_DSOUND)
- SET(HAVE_DSOUND 1)
- SET(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},")
- SET(ALC_OBJS ${ALC_OBJS} Alc/backends/dsound.c)
- ADD_BACKEND_LIBS(${DSOUND_LIBRARIES})
- IF(CMAKE_VERSION VERSION_LESS "2.8.8")
- INCLUDE_DIRECTORIES(${DSOUND_INCLUDE_DIRS})
- ENDIF()
- ENDIF()
-ENDIF()
-IF(ALSOFT_REQUIRE_DSOUND AND NOT HAVE_DSOUND)
- MESSAGE(FATAL_ERROR "Failed to enabled required DSound backend")
-ENDIF()
-
-# Check for MMDevApi backend
OPTION(ALSOFT_REQUIRE_MMDEVAPI "Require MMDevApi backend" OFF)
IF(HAVE_WINDOWS_H)
- CHECK_INCLUDE_FILE(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
- IF(HAVE_MMDEVICEAPI_H)
- OPTION(ALSOFT_BACKEND_MMDEVAPI "Enable MMDevApi backend" ON)
- IF(ALSOFT_BACKEND_MMDEVAPI)
- SET(HAVE_MMDEVAPI 1)
- SET(BACKENDS "${BACKENDS} MMDevApi,")
- SET(ALC_OBJS ${ALC_OBJS} Alc/backends/mmdevapi.c)
- ENDIF()
- ENDIF()
-ENDIF()
-IF(ALSOFT_REQUIRE_MMDEVAPI AND NOT HAVE_MMDEVAPI)
- MESSAGE(FATAL_ERROR "Failed to enabled required MMDevApi backend")
-ENDIF()
-
-# Check MMSystem backend
-OPTION(ALSOFT_REQUIRE_WINMM "Require Windows Multimedia backend" OFF)
-IF(HAVE_WINDOWS_H)
+ # Check MMSystem backend
CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H -D_WIN32_WINNT=0x0502)
IF(HAVE_MMSYSTEM_H)
CHECK_SHARED_FUNCTION_EXISTS(waveOutOpen "windows.h;mmsystem.h" winmm "" HAVE_LIBWINMM)
@@ -862,10 +829,42 @@ IF(HAVE_WINDOWS_H)
ENDIF()
ENDIF()
ENDIF()
+
+ # Check DSound backend
+ FIND_PACKAGE(DSound)
+ IF(DSOUND_FOUND)
+ OPTION(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON)
+ IF(ALSOFT_BACKEND_DSOUND)
+ SET(HAVE_DSOUND 1)
+ SET(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},")
+ SET(ALC_OBJS ${ALC_OBJS} Alc/backends/dsound.c)
+ ADD_BACKEND_LIBS(${DSOUND_LIBRARIES})
+ IF(CMAKE_VERSION VERSION_LESS "2.8.8")
+ INCLUDE_DIRECTORIES(${DSOUND_INCLUDE_DIRS})
+ ENDIF()
+ ENDIF()
+ ENDIF()
+
+ # Check for MMDevApi backend
+ CHECK_INCLUDE_FILE(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
+ IF(HAVE_MMDEVICEAPI_H)
+ OPTION(ALSOFT_BACKEND_MMDEVAPI "Enable MMDevApi backend" ON)
+ IF(ALSOFT_BACKEND_MMDEVAPI)
+ SET(HAVE_MMDEVAPI 1)
+ SET(BACKENDS "${BACKENDS} MMDevApi,")
+ SET(ALC_OBJS ${ALC_OBJS} Alc/backends/mmdevapi.c)
+ ENDIF()
+ ENDIF()
ENDIF()
IF(ALSOFT_REQUIRE_WINMM AND NOT HAVE_WINMM)
MESSAGE(FATAL_ERROR "Failed to enabled required WinMM backend")
ENDIF()
+IF(ALSOFT_REQUIRE_DSOUND AND NOT HAVE_DSOUND)
+ MESSAGE(FATAL_ERROR "Failed to enabled required DSound backend")
+ENDIF()
+IF(ALSOFT_REQUIRE_MMDEVAPI AND NOT HAVE_MMDEVAPI)
+ MESSAGE(FATAL_ERROR "Failed to enabled required MMDevApi backend")
+ENDIF()
# Check PortAudio backend
OPTION(ALSOFT_REQUIRE_PORTAUDIO "Require PortAudio backend" OFF)