Fixed bug 3009 - Cannot compile SDL2 on Windows CMakeLists.txt was missing handling for running CMake with -DDIRECTX=0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b9694c5..4d8b95b 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)
- 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)
+ 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})
set(HAVE_SDL_HAPTIC TRUE)
endif()
endif()
diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake
index c4324f8..34599f2 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@