From b65d0410dc69ca92482d5d2cc736e93bfa61d71e Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Wed, 13 Dec 2017 20:40:47 -0800 Subject: Added /ZW to CMake UWP build; updated readme --- DiligentSamples | 2 +- README.md | 14 +++++++++++--- unityplugin/GhostCubeScene/CMakeLists.txt | 30 ++++++++++++++++++------------ 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/DiligentSamples b/DiligentSamples index 90d2d00..d73473e 160000 --- a/DiligentSamples +++ b/DiligentSamples @@ -1 +1 @@ -Subproject commit 90d2d0013b43069e9d544c42b36386d940c6fa2e +Subproject commit d73473e56e1372609902b467bbf845cfef5b8d2f 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= + +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 - "\"$\"" - "\"$\"") +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 + "\"$\"" + "\"$\"") + 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}) -- cgit v1.2.3