Browse Source

Hopefully fix xinput support not being enabled in SDL.

Alex Szpakowski 10 years ago
parent
commit
0753e6b560
1 changed files with 7 additions and 1 deletions
  1. 7 1
      libs/SDL2/CMakeLists.txt

+ 7 - 1
libs/SDL2/CMakeLists.txt

@@ -887,13 +887,19 @@ elseif(WINDOWS)
       message_error("DIRECTX requires the \$DXSDK_DIR environment variable to be set")
     endif()
     set(CMAKE_REQUIRED_FLAGS "/I\"$ENV{DXSDK_DIR}\\Include\"")
+
+    # xinput.h needs windows.h but doesn't include it itself.
+    check_c_source_compiles("
+      #include <windows.h>
+      #include <xinput.h>
+      int main(int argc, char **argv) { }" HAVE_XINPUT_H)
+
     check_include_file(d3d9.h HAVE_D3D_H)
     check_include_file(d3d11_1.h HAVE_D3D11_H)
     check_include_file(ddraw.h HAVE_DDRAW_H)
     check_include_file(dsound.h HAVE_DSOUND_H)
     check_include_file(dinput.h HAVE_DINPUT_H)
     check_include_file(xaudio2.h HAVE_XAUDIO2_H)
-    check_include_file(xinput.h HAVE_XINPUT_H)
     check_include_file(dxgi.h HAVE_DXGI_H)
     if(HAVE_D3D_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H OR HAVE_XAUDIO2_H)
       set(HAVE_DIRECTX TRUE)