Commit 7b8c75095438abeee6618389499cd7e7d2b92533

okuoku 2021-04-03T22:21:35

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6804107..b78accc 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()