configury, cmake: add check for endpointvolume.h :
authorOzkan Sezer <sezeroz@gmail.com>
Fri, 28 Sep 2018 13:41:04 +0300
changeset 122494f358c108da1
parent 12248 a65c2e471570
child 12250 94e0879b9a6a
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.
CMakeLists.txt
configure
configure.in
include/SDL_config.h.cmake
include/SDL_config.h.in
include/SDL_config_windows.h
include/SDL_config_winrt.h
     1.1 --- a/CMakeLists.txt	Fri Sep 28 11:30:50 2018 +0300
     1.2 +++ b/CMakeLists.txt	Fri Sep 28 13:41:04 2018 +0300
     1.3 @@ -1212,6 +1212,11 @@
     1.4      set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
     1.5    endif()
     1.6  
     1.7 +  # headers needed elsewhere ...
     1.8 +  check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
     1.9 +  check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
    1.10 +  check_include_file(endpointvolume.h HAVE_ENDPOINTVOLUME_H)
    1.11 +
    1.12    if(SDL_AUDIO)
    1.13      set(SDL_AUDIO_DRIVER_WINMM 1)
    1.14      file(GLOB WINMM_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/winmm/*.c)
    1.15 @@ -1224,10 +1229,6 @@
    1.16        set(SOURCE_FILES ${SOURCE_FILES} ${DSOUND_AUDIO_SOURCES})
    1.17      endif()
    1.18  
    1.19 -    # headers needed for WASAPI support:
    1.20 -    check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
    1.21 -    check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
    1.22 -
    1.23      if(WASAPI AND HAVE_AUDIOCLIENT_H AND HAVE_MMDEVICEAPI_H)
    1.24        set(SDL_AUDIO_DRIVER_WASAPI 1)
    1.25        file(GLOB WASAPI_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/wasapi/*.c)
     2.1 --- a/configure	Fri Sep 28 11:30:50 2018 +0300
     2.2 +++ b/configure	Fri Sep 28 13:41:04 2018 +0300
     2.3 @@ -23258,6 +23258,10 @@
     2.4  fi
     2.5  
     2.6  
     2.7 +    if test x$have_wasapi = xyes; then
     2.8 +        $as_echo "#define HAVE_MMDEVICEAPI_H 1" >>confdefs.h
     2.9 +
    2.10 +    fi
    2.11      ac_fn_c_check_header_mongrel "$LINENO" "audioclient.h" "ac_cv_header_audioclient_h" "$ac_includes_default"
    2.12  if test "x$ac_cv_header_audioclient_h" = xyes; then :
    2.13  
    2.14 @@ -23266,6 +23270,19 @@
    2.15  fi
    2.16  
    2.17  
    2.18 +    if test x$have_wasapi = xyes; then
    2.19 +        $as_echo "#define HAVE_AUDIOCLIENT_H 1" >>confdefs.h
    2.20 +
    2.21 +    fi
    2.22 +
    2.23 +    ac_fn_c_check_header_mongrel "$LINENO" "endpointvolume.h" "ac_cv_header_endpointvolume_h" "$ac_includes_default"
    2.24 +if test "x$ac_cv_header_endpointvolume_h" = xyes; then :
    2.25 +  $as_echo "#define HAVE_ENDPOINTVOLUME_H 1" >>confdefs.h
    2.26 +
    2.27 +fi
    2.28 +
    2.29 +
    2.30 +
    2.31      # Check whether --enable-wasapi was given.
    2.32  if test "${enable_wasapi+set}" = set; then :
    2.33    enableval=$enable_wasapi;
     3.1 --- a/configure.in	Fri Sep 28 11:30:50 2018 +0300
     3.2 +++ b/configure.in	Fri Sep 28 13:41:04 2018 +0300
     3.3 @@ -3098,7 +3098,16 @@
     3.4      fi
     3.5  
     3.6      AC_CHECK_HEADER(mmdeviceapi.h, have_wasapi=yes)
     3.7 +    if test x$have_wasapi = xyes; then
     3.8 +        AC_DEFINE(HAVE_MMDEVICEAPI_H,1,[])
     3.9 +    fi
    3.10      AC_CHECK_HEADER(audioclient.h,,have_wasapi=no)
    3.11 +    if test x$have_wasapi = xyes; then
    3.12 +        AC_DEFINE(HAVE_AUDIOCLIENT_H,1,[])
    3.13 +    fi
    3.14 +
    3.15 +    AC_CHECK_HEADER(endpointvolume.h,AC_DEFINE(HAVE_ENDPOINTVOLUME_H,1,[]))
    3.16 +
    3.17      AC_ARG_ENABLE(wasapi,
    3.18  AC_HELP_STRING([--enable-wasapi], [use the Windows WASAPI audio driver [[default=yes]]]),
    3.19                                  , enable_wasapi=yes)
     4.1 --- a/include/SDL_config.h.cmake	Fri Sep 28 11:30:50 2018 +0300
     4.2 +++ b/include/SDL_config.h.cmake	Fri Sep 28 13:41:04 2018 +0300
     4.3 @@ -209,6 +209,11 @@
     4.4  #cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@
     4.5  #cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@
     4.6  #cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@
     4.7 +
     4.8 +#cmakedefine HAVE_ENDPOINTVOLUME_H @HAVE_ENDPOINTVOLUME_H@
     4.9 +#cmakedefine HAVE_MMDEVICEAPI_H @HAVE_MMDEVICEAPI_H@
    4.10 +#cmakedefine HAVE_AUDIOCLIENT_H @HAVE_AUDIOCLIENT_H@
    4.11 +
    4.12  #cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@
    4.13  #cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@
    4.14  
     5.1 --- a/include/SDL_config.h.in	Fri Sep 28 11:30:50 2018 +0300
     5.2 +++ b/include/SDL_config.h.in	Fri Sep 28 13:41:04 2018 +0300
     5.3 @@ -209,6 +209,9 @@
     5.4  #undef HAVE_DSOUND_H
     5.5  #undef HAVE_DXGI_H
     5.6  #undef HAVE_XINPUT_H
     5.7 +#undef HAVE_ENDPOINTVOLUME_H
     5.8 +#undef HAVE_MMDEVICEAPI_H
     5.9 +#undef HAVE_AUDIOCLIENT_H
    5.10  #undef HAVE_XINPUT_GAMEPAD_EX
    5.11  #undef HAVE_XINPUT_STATE_EX
    5.12  
     6.1 --- a/include/SDL_config_windows.h	Fri Sep 28 11:30:50 2018 +0300
     6.2 +++ b/include/SDL_config_windows.h	Fri Sep 28 13:41:04 2018 +0300
     6.3 @@ -82,6 +82,9 @@
     6.4  #define HAVE_DSOUND_H 1
     6.5  #define HAVE_DXGI_H 1
     6.6  #define HAVE_XINPUT_H 1
     6.7 +#define HAVE_MMDEVICEAPI_H 1
     6.8 +#define HAVE_AUDIOCLIENT_H 1
     6.9 +#define HAVE_ENDPOINTVOLUME_H 1
    6.10  
    6.11  /* This is disabled by default to avoid C runtime dependencies and manifest requirements */
    6.12  #ifdef HAVE_LIBC
     7.1 --- a/include/SDL_config_winrt.h	Fri Sep 28 11:30:50 2018 +0300
     7.2 +++ b/include/SDL_config_winrt.h	Fri Sep 28 13:41:04 2018 +0300
     7.3 @@ -97,6 +97,11 @@
     7.4  #if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
     7.5  #define HAVE_XINPUT_H 1
     7.6  #endif
     7.7 +
     7.8 +#define HAVE_MMDEVICEAPI_H 1
     7.9 +#define HAVE_AUDIOCLIENT_H 1
    7.10 +#define HAVE_ENDPOINTVOLUME_H 1
    7.11 +
    7.12  #define HAVE_LIBC 1
    7.13  #define STDC_HEADERS 1
    7.14  #define HAVE_CTYPE_H 1