diff options
-rw-r--r-- | CMakeLists.txt | 71 |
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) |