[Commits] SDL: configury, cmake: make wasapi option independent of directx.

libsdl.org revision control commits-owner at libsdl.org
Fri Sep 28 01:30:58 PDT 2018


details:   https://hg.libsdl.org/SDL/rev/a65c2e471570
changeset: 12248:a65c2e471570
user:      Ozkan Sezer <sezeroz at gmail.com>
date:      Fri Sep 28 11:30:50 2018 +0300
description:
configury, cmake: make wasapi option independent of directx.

diffstat:

 CMakeLists.txt |   8 +++++---
 configure      |  44 ++++++++++++++++++++++----------------------
 configure.in   |  12 ++++++------
 3 files changed, 33 insertions(+), 31 deletions(-)

diffs (136 lines):

diff -r f1cfd508f012 -r a65c2e471570 CMakeLists.txt
--- a/CMakeLists.txt	Fri Sep 28 01:18:54 2018 -0700
+++ b/CMakeLists.txt	Fri Sep 28 11:30:50 2018 +0300
@@ -334,7 +334,7 @@
 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(WASAPI              "Use the Windows WASAPI audio driver" ${WINDOWS})
 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)
@@ -1200,8 +1200,6 @@
     check_include_file(ddraw.h HAVE_DDRAW_H)
     check_include_file(dsound.h HAVE_DSOUND_H)
     check_include_file(dinput.h HAVE_DINPUT_H)
-    check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
-    check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
     check_include_file(dxgi.h HAVE_DXGI_H)
     if(HAVE_D3D_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H)
       set(HAVE_DIRECTX TRUE)
@@ -1226,6 +1224,10 @@
       set(SOURCE_FILES ${SOURCE_FILES} ${DSOUND_AUDIO_SOURCES})
     endif()
 
+    # headers needed for WASAPI support:
+    check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
+    check_include_file(audioclient.h HAVE_AUDIOCLIENT_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)
diff -r f1cfd508f012 -r a65c2e471570 configure
--- a/configure	Fri Sep 28 01:18:54 2018 -0700
+++ b/configure	Fri Sep 28 11:30:50 2018 +0300
@@ -23165,20 +23165,6 @@
 fi
 
 
-        ac_fn_c_check_header_mongrel "$LINENO" "mmdeviceapi.h" "ac_cv_header_mmdeviceapi_h" "$ac_includes_default"
-if test "x$ac_cv_header_mmdeviceapi_h" = xyes; then :
-  have_wasapi=yes
-fi
-
-
-        ac_fn_c_check_header_mongrel "$LINENO" "audioclient.h" "ac_cv_header_audioclient_h" "$ac_includes_default"
-if test "x$ac_cv_header_audioclient_h" = xyes; then :
-
-else
-  have_wasapi=no
-fi
-
-
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -23257,14 +23243,6 @@
         SUMMARY_video="${SUMMARY_video} directx"
         SUMMARY_audio="${SUMMARY_audio} directx"
 
-        # Check whether --enable-wasapi was given.
-if test "${enable_wasapi+set}" = set; then :
-  enableval=$enable_wasapi;
-else
-  enable_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
@@ -23273,6 +23251,28 @@
             ;;
         esac
     fi
+
+    ac_fn_c_check_header_mongrel "$LINENO" "mmdeviceapi.h" "ac_cv_header_mmdeviceapi_h" "$ac_includes_default"
+if test "x$ac_cv_header_mmdeviceapi_h" = xyes; then :
+  have_wasapi=yes
+fi
+
+
+    ac_fn_c_check_header_mongrel "$LINENO" "audioclient.h" "ac_cv_header_audioclient_h" "$ac_includes_default"
+if test "x$ac_cv_header_audioclient_h" = xyes; then :
+
+else
+  have_wasapi=no
+fi
+
+
+    # Check whether --enable-wasapi was given.
+if test "${enable_wasapi+set}" = set; then :
+  enableval=$enable_wasapi;
+else
+  enable_wasapi=yes
+fi
+
 }
 
 CheckDLOPEN()
diff -r f1cfd508f012 -r a65c2e471570 configure.in
--- a/configure.in	Fri Sep 28 01:18:54 2018 -0700
+++ b/configure.in	Fri Sep 28 11:30:50 2018 +0300
@@ -3052,8 +3052,6 @@
         AC_CHECK_HEADER(dinput.h, have_dinput=yes)
         AC_CHECK_HEADER(dxgi.h, have_dxgi=yes)
         AC_CHECK_HEADER(xinput.h, have_xinput=yes)
-        AC_CHECK_HEADER(mmdeviceapi.h, have_wasapi=yes)
-        AC_CHECK_HEADER(audioclient.h,,have_wasapi=no)
         AC_TRY_COMPILE([
 #include <windows.h>
 #include <xinput.h>
@@ -3090,10 +3088,6 @@
         SUMMARY_video="${SUMMARY_video} directx"
         SUMMARY_audio="${SUMMARY_audio} directx"
 
-        AC_ARG_ENABLE(wasapi,
-AC_HELP_STRING([--enable-wasapi], [use the Windows WASAPI audio driver [[default=yes]]]),
-                                , enable_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
@@ -3102,6 +3096,12 @@
             ;;
         esac
     fi
+
+    AC_CHECK_HEADER(mmdeviceapi.h, have_wasapi=yes)
+    AC_CHECK_HEADER(audioclient.h,,have_wasapi=no)
+    AC_ARG_ENABLE(wasapi,
+AC_HELP_STRING([--enable-wasapi], [use the Windows WASAPI audio driver [[default=yes]]]),
+                                , enable_wasapi=yes)
 }
 
 dnl Check for the dlfcn.h interface for dynamically loading objects


More information about the commits mailing list