From d54b125a860e83dac32efc0029e0055f0d1435c3 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 14 Jan 2021 14:53:34 -0800 Subject: [PATCH] Fixed bug 5287 - Support building for UWP with CMake Jan Niklas Hasse Actually the SDL2-static target works, if I set SDL_SENSOR to OFF. Awesome! See this patch: https://github.com/microsoft/vcpkg/blob/master/ports/sdl2/0003-sdl2-fix-uwp-build.patch --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bda90d80..f749f6f3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1400,8 +1400,13 @@ elseif(WINDOWS) endif() endif() + if(WINDOWS_STORE) + file(GLOB WINRT_MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/winrt/*.cpp) + set(SOURCE_FILES ${SOURCE_FILES} ${WINRT_MISC_SOURCES}) + else() file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/windows/*.c) set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES}) + endif() set(HAVE_SDL_MISC TRUE) # Check for DirectX @@ -1524,7 +1529,7 @@ elseif(WINDOWS) set(HAVE_SDL_THREADS TRUE) endif() - if(SDL_SENSOR AND HAVE_SENSORSAPI_H) + if(SDL_SENSOR AND HAVE_SENSORSAPI_H AND NOT WINDOWS_STORE) set(SDL_SENSOR_WINDOWS 1) set(HAVE_SDL_SENSORS TRUE) file(GLOB WINDOWS_SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/windows/*.c)