From a809d62605f0de051c665ae6c981d89d6923533d Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sat, 10 Jul 2021 10:01:40 +0300 Subject: [PATCH] cmake: set SDL_JOYSTICK_RAWINPUT for windows builds Fixes: https://github.com/libsdl-org/SDL/issues/4412 --- CMakeLists.txt | 3 +++ include/SDL_config.h.cmake | 1 + 2 files changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b95a4e16..78b928d17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1684,6 +1684,9 @@ elseif(WINDOWS) if(HAVE_HIDAPI) set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/windows/hid.c) endif() + if (NOT WINDOWS_STORE) + set(SDL_JOYSTICK_RAWINPUT 1) + endif file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/windows/*.c) set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) if(HAVE_DINPUT_H) diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index 0b02cd708..40c5a7ed8 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake @@ -316,6 +316,7 @@ #cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@ #cmakedefine SDL_HAVE_MACHINE_JOYSTICK_H @SDL_HAVE_MACHINE_JOYSTICK_H@ #cmakedefine SDL_JOYSTICK_HIDAPI @SDL_JOYSTICK_HIDAPI@ +#cmakedefine SDL_JOYSTICK_RAWINPUT @SDL_JOYSTICK_RAWINPUT@ #cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@ #cmakedefine SDL_JOYSTICK_VIRTUAL @SDL_JOYSTICK_VIRTUAL@ #cmakedefine SDL_JOYSTICK_VITA @SDL_JOYSTICK_VITA@