summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2017-12-14 02:26:47 +0000
committerEgor Yusov <egor.yusov@gmail.com>2017-12-14 02:26:47 +0000
commitca792090564a12ab85ffcf77f3054d5d6bf3330c (patch)
tree58ce00b38e7057c2df9ae13c642402f123b537da /Graphics
parentAdded option to create shader from bytecode for D3D11 and D3D12 (diff)
downloadDiligentCore-ca792090564a12ab85ffcf77f3054d5d6bf3330c.tar.gz
DiligentCore-ca792090564a12ab85ffcf77f3054d5d6bf3330c.zip
Enabling universal windows platform in cmake
Diffstat (limited to 'Graphics')
-rw-r--r--Graphics/CMakeLists.txt4
-rw-r--r--Graphics/GraphicsEngine/CMakeLists.txt2
-rw-r--r--Graphics/GraphicsEngineD3D11/CMakeLists.txt2
-rw-r--r--Graphics/GraphicsEngineD3D11/interface/RenderDeviceFactoryD3D11.h10
-rw-r--r--Graphics/GraphicsEngineD3D12/CMakeLists.txt2
-rw-r--r--Graphics/GraphicsEngineD3D12/interface/RenderDeviceFactoryD3D12.h13
-rw-r--r--Graphics/GraphicsEngineD3DBase/CMakeLists.txt14
-rw-r--r--Graphics/GraphicsTools/CMakeLists.txt2
8 files changed, 39 insertions, 10 deletions
diff --git a/Graphics/CMakeLists.txt b/Graphics/CMakeLists.txt
index aea71286..b76374e6 100644
--- a/Graphics/CMakeLists.txt
+++ b/Graphics/CMakeLists.txt
@@ -1,6 +1,6 @@
-cmake_minimum_required (VERSION 3.3)
+cmake_minimum_required (VERSION 3.8)
-if(PLATFORM_WIN32 OR PLATFORM_UNVIRSAL_WINDOWS)
+if(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(ARCH 64)
else("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
diff --git a/Graphics/GraphicsEngine/CMakeLists.txt b/Graphics/GraphicsEngine/CMakeLists.txt
index 776b524e..350ff53a 100644
--- a/Graphics/GraphicsEngine/CMakeLists.txt
+++ b/Graphics/GraphicsEngine/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.3)
+cmake_minimum_required (VERSION 3.8)
project(GraphicsEngine CXX)
diff --git a/Graphics/GraphicsEngineD3D11/CMakeLists.txt b/Graphics/GraphicsEngineD3D11/CMakeLists.txt
index 0b59bf48..ef2d02b7 100644
--- a/Graphics/GraphicsEngineD3D11/CMakeLists.txt
+++ b/Graphics/GraphicsEngineD3D11/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.3)
+cmake_minimum_required (VERSION 3.8)
project(GraphicsEngineD3D11 CXX)
diff --git a/Graphics/GraphicsEngineD3D11/interface/RenderDeviceFactoryD3D11.h b/Graphics/GraphicsEngineD3D11/interface/RenderDeviceFactoryD3D11.h
index 0f0a4e28..05337aae 100644
--- a/Graphics/GraphicsEngineD3D11/interface/RenderDeviceFactoryD3D11.h
+++ b/Graphics/GraphicsEngineD3D11/interface/RenderDeviceFactoryD3D11.h
@@ -32,6 +32,10 @@
#include "DeviceContext.h"
#include "SwapChain.h"
+#if PLATFORM_UNIVERSAL_WINDOWS && defined(ENGINE_DLL)
+# include "StringTools.h"
+#endif
+
namespace Diligent
{
@@ -83,7 +87,13 @@ extern "C"
#endif
LibName += ".dll";
+#if PLATFORM_WIN32
auto hModule = LoadLibraryA( LibName.c_str() );
+#elif PLATFORM_UNIVERSAL_WINDOWS
+ auto hModule = LoadPackagedLibrary(Diligent::WidenString(LibName).c_str(), 0);
+#else
+# error Unexpected platform
+#endif
if( hModule == NULL )
{
LOG_ERROR_MESSAGE( "Failed to load ", LibName, " library." );
diff --git a/Graphics/GraphicsEngineD3D12/CMakeLists.txt b/Graphics/GraphicsEngineD3D12/CMakeLists.txt
index ad150c5d..31971cf4 100644
--- a/Graphics/GraphicsEngineD3D12/CMakeLists.txt
+++ b/Graphics/GraphicsEngineD3D12/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.3)
+cmake_minimum_required (VERSION 3.8)
project(GraphicsEngineD3D12 CXX)
diff --git a/Graphics/GraphicsEngineD3D12/interface/RenderDeviceFactoryD3D12.h b/Graphics/GraphicsEngineD3D12/interface/RenderDeviceFactoryD3D12.h
index 3bdaca16..b33d3ec9 100644
--- a/Graphics/GraphicsEngineD3D12/interface/RenderDeviceFactoryD3D12.h
+++ b/Graphics/GraphicsEngineD3D12/interface/RenderDeviceFactoryD3D12.h
@@ -31,6 +31,10 @@
#include "DeviceContext.h"
#include "SwapChain.h"
+#if PLATFORM_UNIVERSAL_WINDOWS && defined(ENGINE_DLL)
+# include "StringTools.h"
+#endif
+
namespace Diligent
{
@@ -83,7 +87,14 @@ extern "C"
#endif
LibName += ".dll";
- auto hModule = LoadLibraryA( LibName.c_str() );
+#if PLATFORM_WIN32
+ auto hModule = LoadLibraryA(LibName.c_str());
+#elif PLATFORM_UNIVERSAL_WINDOWS
+ auto hModule = LoadPackagedLibrary(Diligent::WidenString(LibName).c_str(), 0);
+#else
+# error Unexpected platform
+#endif
+
if( hModule == NULL )
{
LOG_ERROR_MESSAGE( "Failed to load ", LibName, " library." );
diff --git a/Graphics/GraphicsEngineD3DBase/CMakeLists.txt b/Graphics/GraphicsEngineD3DBase/CMakeLists.txt
index 17122d8d..0fd12bca 100644
--- a/Graphics/GraphicsEngineD3DBase/CMakeLists.txt
+++ b/Graphics/GraphicsEngineD3DBase/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.3)
+cmake_minimum_required (VERSION 3.8)
project(GraphicsEngineD3DBase CXX)
@@ -35,13 +35,21 @@ add_custom_target(ProcessHLSLDefinitions
SOURCES
include/HLSLDefinitions.fxh
)
-add_dependencies(ProcessHLSLDefinitions File2String)
+
+if(PLATFORM_UNIVERSAL_WINDOWS)
+ # On Universal Windows Platform, we cannot run File2String utility and will use prebuilt Win32 version
+ get_target_property(FILE2STRING_SOURCE_DIR File2String SOURCE_DIR)
+ set(FILE2STRING_PATH "${FILE2STRING_SOURCE_DIR}/File2String.exe")
+else()
+ add_dependencies(ProcessHLSLDefinitions File2String)
+ set(FILE2STRING_PATH $<TARGET_FILE:File2String>)
+endif()
add_custom_command(TARGET ProcessHLSLDefinitions
# Unfortunately it is not possible to set TARGET directly to GraphicsEngineD3DBase
# because PRE_BUILD is only supported on Visual Studio 8 or later. For all other generators
# PRE_BUILD is treated as PRE_LINK.
- COMMAND $<TARGET_FILE:File2String> include/HLSLDefinitions.fxh include/HLSLDefinitions_inc.fxh
+ COMMAND ${FILE2STRING_PATH} include/HLSLDefinitions.fxh include/HLSLDefinitions_inc.fxh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Processing HLSLDefinitions.fxh"
VERBATIM
diff --git a/Graphics/GraphicsTools/CMakeLists.txt b/Graphics/GraphicsTools/CMakeLists.txt
index ae856796..595b9793 100644
--- a/Graphics/GraphicsTools/CMakeLists.txt
+++ b/Graphics/GraphicsTools/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.3)
+cmake_minimum_required (VERSION 3.8)
project(GraphicsTools CXX)