From 7e8469d1961f7c51176fca6f1a4d1c89ad7bf035 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 31 Oct 2021 09:31:25 -0500 Subject: [PATCH] cmake: Fix MinGW build break in WGI joystick driver Just look for windows.gaming.input.h rather than assuming its presence or absence based on other CMake variables. Fixes MinGW builds in CI --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 294e93c96..3f5b6c0ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1534,6 +1534,7 @@ elseif(WINDOWS) #include XINPUT_STATE_EX s1; int main(int argc, char **argv) { }" HAVE_XINPUT_STATE_EX) + check_include_file(windows.gaming.input.h HAVE_WINDOWS_GAMING_INPUT_H) endif() # headers needed elsewhere @@ -1712,8 +1713,7 @@ elseif(WINDOWS) endif() if(HAVE_XINPUT_H) set(SDL_JOYSTICK_XINPUT 1) - if(NOT CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION STREQUAL "") - # Has Windows 10 SDK, so has Windows.Gaming.Input + if(HAVE_WINDOWS_GAMING_INPUT_H) set(SDL_JOYSTICK_WGI 1) endif() endif()