Skip to content
Permalink
Browse files

CMake: Fixed to work on Windows 8 SDK (thanks, Martin!).

Fixes Bugzilla #3207.
  • Loading branch information
icculus committed Dec 29, 2015
1 parent 2f59284 commit 7ca3b27064de7f9fe88dc53e7a3db6123804fdba
Showing with 6 additions and 3 deletions.
  1. +6 −3 CMakeLists.txt
@@ -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()
@@ -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)
@@ -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()

0 comments on commit 7ca3b27

Please sign in to comment.