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 --- unityplugin/GhostCubeScene/CMakeLists.txt | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'unityplugin') 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