Fixed bug 3009 - Cannot compile SDL2 on Windows
authorSam Lantinga <slouken@libsdl.org>
Sat, 13 Jun 2015 10:47:55 -0700
changeset 9731a8140c580b85
parent 9730 3136a8c1cf0b
child 9732 586417de8897
Fixed bug 3009 - Cannot compile SDL2 on Windows

CMakeLists.txt was missing handling for running CMake with -DDIRECTX=0
CMakeLists.txt
include/SDL_config.h.cmake
     1.1 --- a/CMakeLists.txt	Fri Jun 12 21:10:31 2015 +0200
     1.2 +++ b/CMakeLists.txt	Sat Jun 13 10:47:55 2015 -0700
     1.3 @@ -1031,14 +1031,19 @@
     1.4      set(HAVE_SDL_JOYSTICK TRUE)
     1.5  
     1.6      if(SDL_HAPTIC)
     1.7 -      file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/windows/*.c)
     1.8 +      if(HAVE_DINPUT_H OR HAVE_XINPUT_H)
     1.9 +        file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/windows/*.c)
    1.10 +        if(HAVE_DINPUT_H)
    1.11 +          set(SDL_HAPTIC_DINPUT 1)
    1.12 +        endif()
    1.13 +        if(HAVE_XINPUT_H)
    1.14 +          set(SDL_HAPTIC_XINPUT 1)
    1.15 +        endif()
    1.16 +      else()
    1.17 +        file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c)
    1.18 +        set(SDL_HAPTIC_DUMMY 1)
    1.19 +      endif()
    1.20        set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
    1.21 -      if(HAVE_DINPUT_H)
    1.22 -        set(SDL_HAPTIC_DINPUT 1)
    1.23 -      endif()
    1.24 -      if(HAVE_XINPUT_H)
    1.25 -        set(SDL_HAPTIC_XINPUT 1)
    1.26 -      endif()
    1.27        set(HAVE_SDL_HAPTIC TRUE)
    1.28      endif()
    1.29    endif()
     2.1 --- a/include/SDL_config.h.cmake	Fri Jun 12 21:10:31 2015 +0200
     2.2 +++ b/include/SDL_config.h.cmake	Sat Jun 13 10:47:55 2015 -0700
     2.3 @@ -232,6 +232,7 @@
     2.4  #cmakedefine SDL_INPUT_TSLIB @SDL_INPUT_TSLIB@
     2.5  #cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@
     2.6  #cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@
     2.7 +#cmakedefine SDL_JOYSTICK_XINPUT @SDL_JOYSTICK_XINPUT@
     2.8  #cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@
     2.9  #cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@
    2.10  #cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@
    2.11 @@ -243,6 +244,7 @@
    2.12  #cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@
    2.13  #cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@
    2.14  #cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@
    2.15 +#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
    2.16  
    2.17  /* Enable various shared object loading systems */
    2.18  #cmakedefine SDL_LOADSO_HAIKU @SDL_LOADSO_HAIKU@