Skip to content

Commit

Permalink
cmake: Detect and require d3d11_4.h include.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfonseca committed Oct 11, 2017
1 parent 4252663 commit 5020c0d
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ if (WIN32)

find_package (DirectX)

if (MSVC AND NOT DirectX_D3D11_3_INCLUDE_FOUND)
message (FATAL_ERROR "Windows 10 SDK must be selected (-DCMAKE_SYSTEM_VERSION=10.0) for D3D11.3 support")
if (MSVC AND NOT DirectX_D3D11_4_INCLUDE_FOUND)
# XXX: is it might be necessary to explicitely select it via -DCMAKE_SYSTEM_VERSION=?
message (FATAL_ERROR "Windows 10.0.14393 SDK or newer is required for D3D11.4 support")
endif ()

set (ENABLE_EGL false)
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindDirectX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ if (WIN32)

find_winsdk_header (D3D9 d3d9.h)

find_winsdk_header (D3D11_3 d3d11_3.h)
find_winsdk_header (D3D11_4 d3d11_4.h)

find_winsdk_header (D2D1_1 d2d1_1.h)

Expand Down
2 changes: 1 addition & 1 deletion dispatch/d3d11imports.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include "winsdk_compat.h"

#include <d3d11_3.h>
#include <d3d11_4.h>


#include "dxgiint.h"
Expand Down
2 changes: 1 addition & 1 deletion dispatch/dxgiint.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "winsdk_compat.h"

#include <dxgi1_4.h>
#include <dxgi1_5.h>


DEFINE_GUID(IID_IDXGISwapChainDWM,0xF69F223B,0x45D3,0x4AA0,0x98,0xC8,0xC4,0x0C,0x2B,0x23,0x10,0x29);
Expand Down
6 changes: 3 additions & 3 deletions retrace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,10 @@ if (WIN32)
${CMAKE_SOURCE_DIR}/specs/stdapi.py
)

if (DirectX_D3D11_3_INCLUDE_FOUND)
if (DirectX_D3D11_4_INCLUDE_FOUND)
add_definitions (-DHAVE_DXGI)
include_directories (BEFORE SYSTEM
${DirectX_D3D11_3_INCLUDE_DIR}
${DirectX_D3D11_4_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/thirdparty/directxtex/DirectXTex
)
set (D3DSTATE_SOURCES ${D3DSTATE_SOURCES}
Expand Down Expand Up @@ -336,7 +336,7 @@ if (WIN32)
retrace_common
d3dhelpers
)
if (DirectX_D3D11_3_INCLUDE_FOUND)
if (DirectX_D3D11_4_INCLUDE_FOUND)
target_link_libraries (d3dretrace directxtex)
endif ()

Expand Down
2 changes: 1 addition & 1 deletion thirdparty/directxtex/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include (CheckIncludeFileCXX)

if (DirectX_D3D11_3_INCLUDE_FOUND)
if (DirectX_D3D11_4_INCLUDE_FOUND)

include_directories (BEFORE
${DirectX_D3D11_INCLUDE_DIR}
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/dxerr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
add_definitions (-DHAVE_DDRAW)
add_definitions (-DHAVE_D3D9)

if (DirectX_D3D11_3_INCLUDE_FOUND)
include_directories (BEFORE SYSTEM ${DirectX_D3D11_3_INCLUDE_DIR})
if (DirectX_D3D11_4_INCLUDE_FOUND)
include_directories (BEFORE SYSTEM ${DirectX_D3D11_4_INCLUDE_DIR})
add_definitions (-DHAVE_D3D10_1)
add_definitions (-DHAVE_D3D11_1)
endif ()
Expand Down
4 changes: 2 additions & 2 deletions wrappers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ if (WIN32)
endif ()

# dxgi.dll, d3d10.dll, d3d10_1.dll, d3d11.dll
if (DirectX_D3D11_3_INCLUDE_FOUND)
include_directories (BEFORE SYSTEM ${DirectX_D3D11_3_INCLUDE_DIR})
if (DirectX_D3D11_4_INCLUDE_FOUND)
include_directories (BEFORE SYSTEM ${DirectX_D3D11_4_INCLUDE_DIR})

add_custom_command (
OUTPUT dxgitrace.cpp
Expand Down

0 comments on commit 5020c0d

Please sign in to comment.