Skip to content

Commit

Permalink
CMake: Fixed to work on Windows 8 SDK (thanks, Martin!).
Browse files Browse the repository at this point in the history
Fixes Bugzilla #3207.
  • Loading branch information
icculus committed Dec 29, 2015
1 parent 2f59284 commit 7ca3b27
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Expand Up @@ -900,7 +900,10 @@ elseif(WINDOWS)

# Check for DirectX
if(DIRECTX)
if(NOT CMAKE_COMPILER_IS_MINGW)
if(DEFINED MSVC_VERSION AND NOT ${MSVC_VERSION} LESS 1700)
set(USE_WINSDK_DIRECTX TRUE)
endif()
if(NOT CMAKE_COMPILER_IS_MINGW AND NOT USE_WINSDK_DIRECTX)
if("$ENV{DXSDK_DIR}" STREQUAL "")
message_error("DIRECTX requires the \$DXSDK_DIR environment variable to be set")
endif()
Expand All @@ -926,7 +929,7 @@ elseif(WINDOWS)
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)
if(NOT CMAKE_COMPILER_IS_MINGW)
if(NOT CMAKE_COMPILER_IS_MINGW AND NOT USE_WINSDK_DIRECTX)
# TODO: change $ENV{DXSDL_DIR} to get the path from the include checks
link_directories($ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH})
include_directories($ENV{DXSDK_DIR}\\Include)
Expand Down Expand Up @@ -1044,7 +1047,7 @@ elseif(WINDOWS)
list(APPEND EXTRA_LIBS dinput8 dxguid)
if(CMAKE_COMPILER_IS_MINGW)
list(APPEND EXTRA_LIBS dxerr8)
else()
elseif (NOT USE_WINSDK_DIRECTX)
list(APPEND EXTRA_LIBS dxerr)
endif()
endif()
Expand Down

0 comments on commit 7ca3b27

Please sign in to comment.