diff --git a/CMakeLists.txt b/CMakeLists.txt index b9694c502..4d8b95be4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1031,14 +1031,19 @@ elseif(WINDOWS) set(HAVE_SDL_JOYSTICK TRUE) if(SDL_HAPTIC) - file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/windows/*.c) + if(HAVE_DINPUT_H OR HAVE_XINPUT_H) + file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/windows/*.c) + if(HAVE_DINPUT_H) + set(SDL_HAPTIC_DINPUT 1) + endif() + if(HAVE_XINPUT_H) + set(SDL_HAPTIC_XINPUT 1) + endif() + else() + file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c) + set(SDL_HAPTIC_DUMMY 1) + endif() set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES}) - if(HAVE_DINPUT_H) - set(SDL_HAPTIC_DINPUT 1) - endif() - if(HAVE_XINPUT_H) - set(SDL_HAPTIC_XINPUT 1) - endif() set(HAVE_SDL_HAPTIC TRUE) endif() endif() diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index c4324f803..34599f250 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake @@ -232,6 +232,7 @@ #cmakedefine SDL_INPUT_TSLIB @SDL_INPUT_TSLIB@ #cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@ #cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@ +#cmakedefine SDL_JOYSTICK_XINPUT @SDL_JOYSTICK_XINPUT@ #cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@ #cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@ #cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@ @@ -243,6 +244,7 @@ #cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@ #cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@ #cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@ +#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@ /* Enable various shared object loading systems */ #cmakedefine SDL_LOADSO_HAIKU @SDL_LOADSO_HAIKU@