Skip to content
Permalink
Browse files

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.
  • Loading branch information
sezero committed Sep 28, 2018
1 parent cf7460e commit b11c75e9f47823b41b356ac4ccd9d1afdddecbd1
Showing with 47 additions and 4 deletions.
  1. +5 −4 CMakeLists.txt
  2. +17 −0 configure
  3. +9 −0 configure.in
  4. +5 −0 include/SDL_config.h.cmake
  5. +3 −0 include/SDL_config.h.in
  6. +3 −0 include/SDL_config_windows.h
  7. +5 −0 include/SDL_config_winrt.h
@@ -1212,6 +1212,11 @@ elseif(WINDOWS)
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 @@ elseif(WINDOWS)
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)
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 :

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;
@@ -3098,7 +3098,16 @@ XINPUT_STATE_EX s1;
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)
@@ -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@

@@ -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

@@ -82,6 +82,9 @@ typedef unsigned int uintptr_t;
#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
@@ -97,6 +97,11 @@ typedef unsigned int uintptr_t;
#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

0 comments on commit b11c75e

Please sign in to comment.