cmake: add WASAPI audio target to the build (thanks, Martin!).
authorRyan C. Gordon <icculus@icculus.org>
Thu, 23 Feb 2017 22:38:04 -0500
changeset 10907e64cf9261cc7
parent 10906 66a188fbf8bf
child 10908 bd884105b09b
cmake: add WASAPI audio target to the build (thanks, Martin!).

Fixes Bugzilla #3588.
CMakeLists.txt
include/SDL_config.h.cmake
     1.1 --- a/CMakeLists.txt	Thu Feb 23 12:10:02 2017 -0800
     1.2 +++ b/CMakeLists.txt	Thu Feb 23 22:38:04 2017 -0500
     1.3 @@ -1075,6 +1075,7 @@
     1.4      check_include_file(dsound.h HAVE_DSOUND_H)
     1.5      check_include_file(dinput.h HAVE_DINPUT_H)
     1.6      check_include_file(xaudio2.h HAVE_XAUDIO2_H)
     1.7 +    check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
     1.8      check_include_file(dxgi.h HAVE_DXGI_H)
     1.9      if(HAVE_D3D_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H OR HAVE_XAUDIO2_H)
    1.10        set(HAVE_DIRECTX TRUE)
    1.11 @@ -1104,6 +1105,12 @@
    1.12        file(GLOB XAUDIO2_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/xaudio2/*.c)
    1.13        set(SOURCE_FILES ${SOURCE_FILES} ${XAUDIO2_AUDIO_SOURCES})
    1.14      endif()
    1.15 +
    1.16 +    if(HAVE_AUDIOCLIENT_H)
    1.17 +      set(SDL_AUDIO_DRIVER_WASAPI 1)
    1.18 +      file(GLOB WASAPI_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/wasapi/*.c)
    1.19 +      set(SOURCE_FILES ${SOURCE_FILES} ${WASAPI_AUDIO_SOURCES})
    1.20 +    endif()
    1.21    endif()
    1.22  
    1.23    if(SDL_VIDEO)
     2.1 --- a/include/SDL_config.h.cmake	Thu Feb 23 12:10:02 2017 -0800
     2.2 +++ b/include/SDL_config.h.cmake	Thu Feb 23 22:38:04 2017 -0500
     2.3 @@ -215,6 +215,7 @@
     2.4  #cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@
     2.5  #cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@
     2.6  #cmakedefine SDL_AUDIO_DRIVER_XAUDIO2 @SDL_AUDIO_DRIVER_XAUDIO2@
     2.7 +#cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@
     2.8  #cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@
     2.9  #cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@
    2.10  #cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@