From b5614d0c6e81fd1e127ad0444765a6e5a7a6ef3d Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Fri, 4 Feb 2022 20:05:14 +0300 Subject: [PATCH] cmake: fix UWP joystick. from: https://github.com/microsoft/vcpkg/blob/master/ports/sdl2/0005-Fix-uwp-joystick.patch --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8af3bacbe..26fc3309b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1783,8 +1783,10 @@ elseif(WINDOWS) list(APPEND EXTRA_LIBS dinput8) endif() if(HAVE_XINPUT_H) - set(SDL_JOYSTICK_XINPUT 1) - set(HAVE_XINPUT TRUE) + if(NOT WINDOWS_STORE) + set(SDL_JOYSTICK_XINPUT 1) + set(HAVE_XINPUT TRUE) + endif() if(HAVE_WINDOWS_GAMING_INPUT_H) set(SDL_JOYSTICK_WGI 1) endif() @@ -1792,7 +1794,7 @@ elseif(WINDOWS) set(HAVE_SDL_JOYSTICK TRUE) if(SDL_HAPTIC) - if(HAVE_DINPUT_H OR HAVE_XINPUT_H) + if((HAVE_DINPUT_H OR HAVE_XINPUT_H) AND NOT WINDOWS_STORE) file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/windows/*.c) if(HAVE_DINPUT_H) set(SDL_HAPTIC_DINPUT 1)