From d284ff54b69525b50ef3900c3ed220f6cfb71c53 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 11 Dec 2019 16:19:23 -0800 Subject: [PATCH] More Cmake code review --- CMakeLists.txt | 9 +++++++-- DirectXTex/DirectXTex.h | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ec3ee4..71e5773 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,5 +112,10 @@ if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" ) target_compile_options(texdiag PRIVATE ${WarningsEXE}) endif() -# Windows 10 is used here to build the DirectX 12 code paths as well as 11 -add_compile_definitions(_UNICODE UNICODE _WIN32_WINNT=0x0A00) +if(WIN32) + # Windows 10 is used here to build the DirectX 12 code paths as well as 11 + target_compile_definitions(${PROJECT_NAME} PRIVATE _UNICODE UNICODE _WIN32_WINNT=0x0A00) + target_compile_definitions(texassemble PRIVATE _UNICODE UNICODE _WIN32_WINNT=0x0A00) + target_compile_definitions(texconv PRIVATE _UNICODE UNICODE _WIN32_WINNT=0x0A00) + target_compile_definitions(texdiag PRIVATE _UNICODE UNICODE _WIN32_WINNT=0x0A00) +endif() diff --git a/DirectXTex/DirectXTex.h b/DirectXTex/DirectXTex.h index 7ffa7db..48c82ab 100644 --- a/DirectXTex/DirectXTex.h +++ b/DirectXTex/DirectXTex.h @@ -17,7 +17,7 @@ #include #include -#if !defined(__d3d11_h__) && !defined(__d3d11_x_h__) && !defined(__d3d12_h__) && !defined(__d3d12_x_h__) +#if !defined(__d3d11_h__) && !defined(__d3d11_x_h__) && !defined(__d3d12_h__) && !defined(__d3d12_x_h__) && !defined(__XBOX_D3D12_X__) #if defined(_XBOX_ONE) && defined(_TITLE) #include #else @@ -754,7 +754,7 @@ namespace DirectX //--------------------------------------------------------------------------------- // Direct3D 12 functions -#if defined(__d3d12_h__) || defined(__d3d12_x_h__) +#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__) bool __cdecl IsSupportedTexture(_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata); HRESULT __cdecl CreateTexture(