CMakeLists.txt
changeset 9853 3d08cb641cd5
parent 9758 cf4d3ee2b37b
child 9854 dbcbdc2940ef
     1.1 --- a/CMakeLists.txt	Mon Aug 24 22:35:01 2015 +0200
     1.2 +++ b/CMakeLists.txt	Fri Aug 28 19:05:24 2015 -0300
     1.3 @@ -906,13 +906,23 @@
     1.4        endif()
     1.5        set(CMAKE_REQUIRED_FLAGS "/I\"$ENV{DXSDK_DIR}\\Include\"")
     1.6      endif()
     1.7 +
     1.8 +    if(HAVE_WIN32_CC)
     1.9 +      # xinput.h may need windows.h, but doesn't include it itself.
    1.10 +      check_c_source_compiles("
    1.11 +        #include <windows.h>
    1.12 +        #include <xinput.h>
    1.13 +        int main(int argc, char **argv) { }" HAVE_XINPUT_H)
    1.14 +    else()
    1.15 +      check_include_file(xinput.h HAVE_XINPUT_H)
    1.16 +    endif()
    1.17 +
    1.18      check_include_file(d3d9.h HAVE_D3D_H)
    1.19      check_include_file(d3d11_1.h HAVE_D3D11_H)
    1.20      check_include_file(ddraw.h HAVE_DDRAW_H)
    1.21      check_include_file(dsound.h HAVE_DSOUND_H)
    1.22      check_include_file(dinput.h HAVE_DINPUT_H)
    1.23      check_include_file(xaudio2.h HAVE_XAUDIO2_H)
    1.24 -    check_include_file(xinput.h HAVE_XINPUT_H)
    1.25      check_include_file(dxgi.h HAVE_DXGI_H)
    1.26      if(HAVE_D3D_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H OR HAVE_XAUDIO2_H)
    1.27        set(HAVE_DIRECTX TRUE)