[Commits] SDL: configury, cmake: add check for endpointvolume.h :

libsdl.org revision control commits-owner at libsdl.org
Fri Sep 28 03:44:27 PDT 2018


details:   https://hg.libsdl.org/SDL/rev/4f358c108da1
changeset: 12249:4f358c108da1
user:      Ozkan Sezer <sezeroz at gmail.com>
date:      Fri Sep 28 13:41:04 2018 +0300
description:
configury, cmake:  add check for endpointvolume.h :

add HAVE_ENDPOINTVOLUME_H, HAVE_MMDEVICEAPI_H and HAVE_AUDIOCLIENT_H
in SDL_config.h.in, SDL_config.h.cmake, SDL_config_windows.h, and in
SDL_config_winrt.h.

diffstat:

 CMakeLists.txt               |   9 +++++----
 configure                    |  17 +++++++++++++++++
 configure.in                 |   9 +++++++++
 include/SDL_config.h.cmake   |   5 +++++
 include/SDL_config.h.in      |   3 +++
 include/SDL_config_windows.h |   3 +++
 include/SDL_config_winrt.h   |   5 +++++
 7 files changed, 47 insertions(+), 4 deletions(-)

diffs (136 lines):

diff -r a65c2e471570 -r 4f358c108da1 CMakeLists.txt
--- a/CMakeLists.txt	Fri Sep 28 11:30:50 2018 +0300
+++ b/CMakeLists.txt	Fri Sep 28 13:41:04 2018 +0300
@@ -1212,6 +1212,11 @@
     set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
   endif()
 
+  # headers needed elsewhere ...
+  check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
+  check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
+  check_include_file(endpointvolume.h HAVE_ENDPOINTVOLUME_H)
+
   if(SDL_AUDIO)
     set(SDL_AUDIO_DRIVER_WINMM 1)
     file(GLOB WINMM_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/winmm/*.c)
@@ -1224,10 +1229,6 @@
       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 a65c2e471570 -r 4f358c108da1 configure
--- a/configure	Fri Sep 28 11:30:50 2018 +0300
+++ b/configure	Fri Sep 28 13:41:04 2018 +0300
@@ -23258,6 +23258,10 @@
 fi
 
 
+    if test x$have_wasapi = xyes; then
+        $as_echo "#define HAVE_MMDEVICEAPI_H 1" >>confdefs.h
+
+    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 :
 
@@ -23266,6 +23270,19 @@
 fi
 
 
+    if test x$have_wasapi = xyes; then
+        $as_echo "#define HAVE_AUDIOCLIENT_H 1" >>confdefs.h
+
+    fi
+
+    ac_fn_c_check_header_mongrel "$LINENO" "endpointvolume.h" "ac_cv_header_endpointvolume_h" "$ac_includes_default"
+if test "x$ac_cv_header_endpointvolume_h" = xyes; then :
+  $as_echo "#define HAVE_ENDPOINTVOLUME_H 1" >>confdefs.h
+
+fi
+
+
+
     # Check whether --enable-wasapi was given.
 if test "${enable_wasapi+set}" = set; then :
   enableval=$enable_wasapi;
diff -r a65c2e471570 -r 4f358c108da1 configure.in
--- a/configure.in	Fri Sep 28 11:30:50 2018 +0300
+++ b/configure.in	Fri Sep 28 13:41:04 2018 +0300
@@ -3098,7 +3098,16 @@
     fi
 
     AC_CHECK_HEADER(mmdeviceapi.h, have_wasapi=yes)
+    if test x$have_wasapi = xyes; then
+        AC_DEFINE(HAVE_MMDEVICEAPI_H,1,[])
+    fi
     AC_CHECK_HEADER(audioclient.h,,have_wasapi=no)
+    if test x$have_wasapi = xyes; then
+        AC_DEFINE(HAVE_AUDIOCLIENT_H,1,[])
+    fi
+
+    AC_CHECK_HEADER(endpointvolume.h,AC_DEFINE(HAVE_ENDPOINTVOLUME_H,1,[]))
+
     AC_ARG_ENABLE(wasapi,
 AC_HELP_STRING([--enable-wasapi], [use the Windows WASAPI audio driver [[default=yes]]]),
                                 , enable_wasapi=yes)
diff -r a65c2e471570 -r 4f358c108da1 include/SDL_config.h.cmake
--- a/include/SDL_config.h.cmake	Fri Sep 28 11:30:50 2018 +0300
+++ b/include/SDL_config.h.cmake	Fri Sep 28 13:41:04 2018 +0300
@@ -209,6 +209,11 @@
 #cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@
 #cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@
 #cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@
+
+#cmakedefine HAVE_ENDPOINTVOLUME_H @HAVE_ENDPOINTVOLUME_H@
+#cmakedefine HAVE_MMDEVICEAPI_H @HAVE_MMDEVICEAPI_H@
+#cmakedefine HAVE_AUDIOCLIENT_H @HAVE_AUDIOCLIENT_H@
+
 #cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@
 #cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@
 
diff -r a65c2e471570 -r 4f358c108da1 include/SDL_config.h.in
--- a/include/SDL_config.h.in	Fri Sep 28 11:30:50 2018 +0300
+++ b/include/SDL_config.h.in	Fri Sep 28 13:41:04 2018 +0300
@@ -209,6 +209,9 @@
 #undef HAVE_DSOUND_H
 #undef HAVE_DXGI_H
 #undef HAVE_XINPUT_H
+#undef HAVE_ENDPOINTVOLUME_H
+#undef HAVE_MMDEVICEAPI_H
+#undef HAVE_AUDIOCLIENT_H
 #undef HAVE_XINPUT_GAMEPAD_EX
 #undef HAVE_XINPUT_STATE_EX
 
diff -r a65c2e471570 -r 4f358c108da1 include/SDL_config_windows.h
--- a/include/SDL_config_windows.h	Fri Sep 28 11:30:50 2018 +0300
+++ b/include/SDL_config_windows.h	Fri Sep 28 13:41:04 2018 +0300
@@ -82,6 +82,9 @@
 #define HAVE_DSOUND_H 1
 #define HAVE_DXGI_H 1
 #define HAVE_XINPUT_H 1
+#define HAVE_MMDEVICEAPI_H 1
+#define HAVE_AUDIOCLIENT_H 1
+#define HAVE_ENDPOINTVOLUME_H 1
 
 /* This is disabled by default to avoid C runtime dependencies and manifest requirements */
 #ifdef HAVE_LIBC
diff -r a65c2e471570 -r 4f358c108da1 include/SDL_config_winrt.h
--- a/include/SDL_config_winrt.h	Fri Sep 28 11:30:50 2018 +0300
+++ b/include/SDL_config_winrt.h	Fri Sep 28 13:41:04 2018 +0300
@@ -97,6 +97,11 @@
 #if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
 #define HAVE_XINPUT_H 1
 #endif
+
+#define HAVE_MMDEVICEAPI_H 1
+#define HAVE_AUDIOCLIENT_H 1
+#define HAVE_ENDPOINTVOLUME_H 1
+
 #define HAVE_LIBC 1
 #define STDC_HEADERS 1
 #define HAVE_CTYPE_H 1


More information about the commits mailing list