cmake: add WASAPI audio target to the build (thanks, Martin!).

Fixes Bugzilla #3588.
Ryan C. Gordon 2017-02-23 22:38:04 -05:00
parent 71a4e8ed13
commit 0e7530b057
2 changed files with 8 additions and 0 deletions

View File

@ -1075,6 +1075,7 @@ elseif(WINDOWS)
check_include_file(dsound.h HAVE_DSOUND_H)
check_include_file(dinput.h HAVE_DINPUT_H)
check_include_file(xaudio2.h HAVE_XAUDIO2_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 OR HAVE_XAUDIO2_H)
set(HAVE_DIRECTX TRUE)
@ -1104,6 +1105,12 @@ elseif(WINDOWS)
file(GLOB XAUDIO2_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/xaudio2/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${XAUDIO2_AUDIO_SOURCES})
endif()
if(HAVE_AUDIOCLIENT_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})
endif()
endif()
if(SDL_VIDEO)

View File

@ -215,6 +215,7 @@
#cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@
#cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@
#cmakedefine SDL_AUDIO_DRIVER_XAUDIO2 @SDL_AUDIO_DRIVER_XAUDIO2@
#cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@
#cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@
#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@
#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@