From 7b8c75095438abeee6618389499cd7e7d2b92533 Mon Sep 17 00:00:00 2001 From: okuoku Date: Sat, 3 Apr 2021 22:21:35 +0900 Subject: [PATCH] CMake: Enable WASAPI on WinRT WASAPI backend on WinRT was implemented with 2.0.8 https://github.com/libsdl-org/SDL/commit/351d6d478443fe8a1ede1e993712f07cb369d483 but CMake source here was written for 2.0.7 in vcpkg https://github.com/microsoft/vcpkg/commit/e6c65b93b125cf0be13254cf2f5a9d27cb009707 --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68041078c..b78accc85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1505,9 +1505,12 @@ elseif(WINDOWS) set(SOURCE_FILES ${SOURCE_FILES} ${DSOUND_AUDIO_SOURCES}) endif() - if(WASAPI AND HAVE_AUDIOCLIENT_H AND HAVE_MMDEVICEAPI_H AND NOT WINDOWS_STORE) + 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) + if(WINDOWS_STORE) + list(APPEND WASAPI_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/wasapi/SDL_wasapi_winrt.cpp) + endif() set(SOURCE_FILES ${SOURCE_FILES} ${WASAPI_AUDIO_SOURCES}) endif() endif()