summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2017-12-14 04:40:47 +0000
committerEgor Yusov <egor.yusov@gmail.com>2017-12-14 04:40:47 +0000
commitb65d0410dc69ca92482d5d2cc736e93bfa61d71e (patch)
tree4ca7ae0ea5dedecc94fb1d6307f12a2371d1a045
parentOptimized CMake files with set_common_target_properties() (diff)
downloadDiligentEngine-b65d0410dc69ca92482d5d2cc736e93bfa61d71e.tar.gz
DiligentEngine-b65d0410dc69ca92482d5d2cc736e93bfa61d71e.zip
Added /ZW to CMake UWP build; updated readme
m---------DiligentSamples0
-rw-r--r--README.md14
-rw-r--r--unityplugin/GhostCubeScene/CMakeLists.txt30
3 files changed, 29 insertions, 15 deletions
diff --git a/DiligentSamples b/DiligentSamples
-Subproject 90d2d0013b43069e9d544c42b36386d940c6fa2
+Subproject d73473e56e1372609902b467bbf845cfef5b8d2
diff --git a/README.md b/README.md
index c6fcb7c..aea382d 100644
--- a/README.md
+++ b/README.md
@@ -92,9 +92,9 @@ Reworking Diligent Engine build system with CMake is in progress.
To generate build files for Windows desktop platform, use either CMake GUI or command line tool. The build system uses standalone
effect compiler, path to which needs to be specified via FXC variable. For example, to generate Visual Studio 2017 64-bit
-solution and project files in cmk_build folder, navigate to the engine's root folder and run the following command:
+solution and project files in *cmk_build/Win64* folder, navigate to the engine's root folder and run the following command:
-cmake -D FXC="C:/Program Files (x86)/Windows Kits/10/bin/x86/fxc.exe" -H. -B./cmk_build -G "Visual Studio 15 2017 Win64"
+*cmake -D FXC="C:/Program Files (x86)/Windows Kits/10/bin/x86/fxc.exe" -H. -B./cmk_build/Win64 -G "Visual Studio 15 2017 Win64"*
**WARNING!** In current implementation, full path to cmake build folder **must not contain white spaces**. (If anybody knows a way
to add quotes to CMake's custom commands, please let me know!)
@@ -104,7 +104,15 @@ demo will be set up as startup project.
## Universal Windows Platform
-Not yet supported
+To generate build files for Universal Windows platform, you need to define the following two cmake variables:
+
+* CMAKE_SYSTEM_NAME=WindowsStore
+* CMAKE_SYSTEM_VERSION=<Windows SDK Version>
+
+For example, to generate Visual Studio 2017 64-bit solution and project files in *cmk_build/UWP64* folder, run the following command
+from the engine's root folder:
+
+*cmake -D FXC="C:/Program Files (x86)/Windows Kits/10/bin/x86/fxc.exe" -D CMAKE_SYSTEM_NAME=WindowsStore -D CMAKE_SYSTEM_VERSION=10.0.15063.0 -H. -B./cmk_build/UWP64 -G "Visual Studio 15 2017 Win64"*
## Android
diff --git a/unityplugin/GhostCubeScene/CMakeLists.txt b/unityplugin/GhostCubeScene/CMakeLists.txt
index cdf461d..b78fb54 100644
--- a/unityplugin/GhostCubeScene/CMakeLists.txt
+++ b/unityplugin/GhostCubeScene/CMakeLists.txt
@@ -17,19 +17,20 @@ elseif(PLATFORM_ANDROID)
list(APPEND SOURCE src/Android/AndroidMain.cpp)
endif()
-if(PLATFORM_WIN32)
- add_executable(GhostCubeScene WIN32 ${SOURCE} ${INCLUDE})
- set_target_properties(GhostCubeScene PROPERTIES
- VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build/assets"
- )
-
- add_custom_command(TARGET GhostCubeScene POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- "\"$<TARGET_FILE:GhostCubePlugin-shared>\""
- "\"$<TARGET_FILE_DIR:GhostCubeScene>\"")
+if(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS)
-elseif(PLATFORM_UNIVERSAL_WINDOWS)
add_executable(GhostCubeScene WIN32 ${SOURCE} ${INCLUDE})
+
+ if(PLATFORM_WIN32)
+ set_target_properties(GhostCubeScene PROPERTIES
+ VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build/assets"
+ )
+
+ add_custom_command(TARGET GhostCubeScene POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "\"$<TARGET_FILE:GhostCubePlugin-shared>\""
+ "\"$<TARGET_FILE_DIR:GhostCubeScene>\"")
+ endif()
#elseif(APPLE)
#add_executable(GhostCubeScene MACOSX_BUNDLE Main.cpp)
@@ -63,8 +64,13 @@ set_common_target_properties(GhostCubeScene)
if(MSVC)
# Disable MSVC-specific warnings
- # - w4201: nonstandard extension used: nameless struct/unio
+ # - w4201: nonstandard extension used: nameless struct/union
target_compile_options(GhostCubeScene PRIVATE /wd4201)
+
+ if(PLATFORM_UNIVERSAL_WINDOWS)
+ # Consume the windows runtime extensions
+ target_compile_options(GhostCubeScene PRIVATE /ZW)
+ endif()
endif()
source_group("src" FILES ${SOURCE})