Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
make WASAPI configurable in autofoo and cmake (default is on.)
- Loading branch information
Showing
with
20 additions
and
3 deletions.
-
+2
−1
CMakeLists.txt
-
+12
−1
configure
-
+6
−1
configure.in
|
@@ -328,6 +328,7 @@ foreach(_SUB ${SDL_X11_OPTIONS}) |
|
|
endforeach() |
|
|
set_option(VIDEO_COCOA "Use Cocoa video driver" ${APPLE}) |
|
|
set_option(DIRECTX "Use DirectX for Windows audio/video" ${WINDOWS}) |
|
|
dep_option(WASAPI "Use the Windows WASAPI audio driver" ON "DIRECTX" OFF) |
|
|
set_option(RENDER_D3D "Enable the Direct3D render driver" ${WINDOWS}) |
|
|
set_option(VIDEO_VIVANTE "Use Vivante EGL video driver" ${UNIX_SYS}) |
|
|
dep_option(VIDEO_VULKAN "Enable Vulkan support" ON "ANDROID OR APPLE OR LINUX OR WINDOWS" OFF) |
|
@@ -1209,7 +1210,7 @@ elseif(WINDOWS) |
|
|
set(SOURCE_FILES ${SOURCE_FILES} ${DSOUND_AUDIO_SOURCES}) |
|
|
endif() |
|
|
|
|
|
if(HAVE_AUDIOCLIENT_H AND HAVE_MMDEVICEAPI_H) |
|
|
if(WASAPI AND HAVE_AUDIOCLIENT_H AND HAVE_MMDEVICEAPI_H) |
|
|
set(SDL_AUDIO_DRIVER_WASAPI 1) |
|
|
file(GLOB WASAPI_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/wasapi/*.c) |
|
|
set(SOURCE_FILES ${SOURCE_FILES} ${WASAPI_AUDIO_SOURCES}) |
|
|
|
@@ -866,6 +866,7 @@ enable_input_tslib |
|
|
enable_pthreads |
|
|
enable_pthread_sem |
|
|
enable_directx |
|
|
enable_audio_wasapi |
|
|
enable_sdl_dlopen |
|
|
enable_clock_gettime |
|
|
enable_rpath |
|
@@ -1620,6 +1621,7 @@ Optional Features: |
|
|
[[default=yes]] |
|
|
--enable-pthread-sem use pthread semaphores [[default=yes]] |
|
|
--enable-directx use DirectX for Windows audio/video [[default=yes]] |
|
|
--enable-audio-wasapi use the Windows WASAPI audio driver [[default=yes]] |
|
|
--enable-sdl-dlopen use dlopen for shared object loading [[default=yes]] |
|
|
--enable-clock_gettime use clock_gettime() instead of gettimeofday() on |
|
|
UNIX [[default=yes]] |
|
|
|
|
SUMMARY_video="${SUMMARY_video} directx" |
|
|
SUMMARY_audio="${SUMMARY_audio} directx" |
|
|
|
|
|
# Check whether --enable-audio-wasapi was given. |
|
|
if test "${enable_audio_wasapi+set}" = set; then : |
|
|
enableval=$enable_audio_wasapi; |
|
|
else |
|
|
enable_audio_wasapi=yes |
|
|
fi |
|
|
|
|
|
|
|
|
# FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers. |
|
|
# FIXME: ...so force it off for now. |
|
|
case "$host" in |
|
|
|
|
|
|
|
SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c" |
|
|
fi |
|
|
if test x$have_wasapi = xyes; then |
|
|
if test x$have_wasapi = xyes -a x$enable_audio_wasapi = xyes; then |
|
|
|
|
|
$as_echo "#define SDL_AUDIO_DRIVER_WASAPI 1" >>confdefs.h |
|
|
|
|
|
SUMMARY_audio="${SUMMARY_audio} wasapi" |
|
|
SOURCES="$SOURCES $srcdir/src/audio/wasapi/*.c" |
|
|
fi |
|
|
have_audio=yes |
|
@@ -3079,6 +3079,10 @@ XINPUT_STATE_EX s1; |
|
|
SUMMARY_video="${SUMMARY_video} directx" |
|
|
SUMMARY_audio="${SUMMARY_audio} directx" |
|
|
|
|
|
AC_ARG_ENABLE(audio-wasapi, |
|
|
AC_HELP_STRING([--enable-audio-wasapi], [use the Windows WASAPI audio driver [[default=yes]]]), |
|
|
, enable_audio_wasapi=yes) |
|
|
|
|
|
# FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers. |
|
|
# FIXME: ...so force it off for now. |
|
|
case "$host" in |
|
@@ -3547,8 +3551,9 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau |
|
|
AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ]) |
|
|
SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c" |
|
|
fi |
|
|
if test x$have_wasapi = xyes; then |
|
|
if test x$have_wasapi = xyes -a x$enable_audio_wasapi = xyes; then |
|
|
AC_DEFINE(SDL_AUDIO_DRIVER_WASAPI, 1, [ ]) |
|
|
SUMMARY_audio="${SUMMARY_audio} wasapi" |
|
|
SOURCES="$SOURCES $srcdir/src/audio/wasapi/*.c" |
|
|
fi |
|
|
have_audio=yes |
|
|