cmake: Add missing SDL_JOYSTICK_WGI in config step

SDL_config.h *can* define SDL_JOYSTICK_WGI. On builds with the Windows
10 SDK available, this allow implementing trigger rumbling on Xbox One
controllers. The files included in the Visual Studio Solution in
VisualC\SDL.sln *do* have this define set.

fix #4859
main
Ybalrid (Arthur Brainville) 2021-10-31 02:54:20 +02:00 committed by Sam Lantinga
parent 8a4a282aaa
commit 81fe2ccb9c
2 changed files with 10 additions and 5 deletions

View File

@ -1712,6 +1712,10 @@ elseif(WINDOWS)
endif() endif()
if(HAVE_XINPUT_H) if(HAVE_XINPUT_H)
set(SDL_JOYSTICK_XINPUT 1) set(SDL_JOYSTICK_XINPUT 1)
if(NOT CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION STREQUAL "")
# Has Windows 10 SDK, so has Windows.Gaming.Input
set(SDL_JOYSTICK_WGI 1)
endif()
endif() endif()
if(NOT HAVE_DINPUT_H AND NOT HAVE_XINPUT_H) if(NOT HAVE_DINPUT_H AND NOT HAVE_XINPUT_H)
set(SDL_JOYSTICK_WINMM 1) set(SDL_JOYSTICK_WINMM 1)

View File

@ -319,6 +319,7 @@
#cmakedefine SDL_INPUT_FBSDKBIO @SDL_INPUT_FBSDKBIO@ #cmakedefine SDL_INPUT_FBSDKBIO @SDL_INPUT_FBSDKBIO@
#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@ #cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@
#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@ #cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@
#cmakedefine SDL_JOYSTICK_WGI @SDL_JOYSTICK_WGI@
#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@ #cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@
#cmakedefine SDL_JOYSTICK_XINPUT @SDL_JOYSTICK_XINPUT@ #cmakedefine SDL_JOYSTICK_XINPUT @SDL_JOYSTICK_XINPUT@
#cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@ #cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@