Fixed bug 3009 - Cannot compile SDL2 on Windows

CMakeLists.txt was missing handling for running CMake with -DDIRECTX=0
This commit is contained in:
Sam Lantinga 2015-06-13 10:47:55 -07:00
parent d8c2b36c21
commit aee0552229
2 changed files with 14 additions and 7 deletions

View File

@ -1031,14 +1031,19 @@ elseif(WINDOWS)
set(HAVE_SDL_JOYSTICK TRUE)
if(SDL_HAPTIC)
if(HAVE_DINPUT_H OR HAVE_XINPUT_H)
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)
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()

View File

@ -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@