aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Schultz <karl@lunarg.com>2018-04-20 10:49:41 -0600
committerKarl Schultz <karl@lunarg.com>2018-04-20 14:14:50 -0600
commit437620348d782df074850cdb733395e5e06e6acf (patch)
treeb2c3f36b93b65a0701e55515ef3e9d88217816c6
parent99b0d0c37e6e014272397756b1ae13034aa9fc0b (diff)
downloadusermoji-437620348d782df074850cdb733395e5e06e6acf.tar.xz
build(win): Add dep to create dir before use
Add a CMake dependency for Windows builds to create the layers/$CONFIG directory before running any of the other steps that copy the layer json files to this directory. This failure was sporadic and often did not fail because other build steps that compiled the layers often created this directory before the copy steps executed. Because of the difficulty in reproducing this problem, it is not certain that this fixes the problem. However, the mac Xcode builds were already using this pattern to achieve the same goal.
-rw-r--r--layers/CMakeLists.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt
index 7a1390a2..9ade6a03 100644
--- a/layers/CMakeLists.txt
+++ b/layers/CMakeLists.txt
@@ -1,6 +1,8 @@
cmake_minimum_required (VERSION 2.8.11)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_definitions(-DVK_USE_PLATFORM_WIN32_KHR -DVK_USE_PLATFORM_WIN32_KHX -DWIN32_LEAN_AND_MEAN)
+ add_custom_target(mk_layer_config_dir ALL COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)
+ set_target_properties(mk_layer_config_dir PROPERTIES FOLDER ${LVL_TARGET_FOLDER})
set(DisplayServer Win32)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
add_definitions(-DVK_USE_PLATFORM_ANDROID_KHR -DVK_USE_PLATFORM_ANDROID_KHX)
@@ -48,8 +50,9 @@ if (WIN32)
if (CMAKE_GENERATOR MATCHES "^Visual Studio.*")
foreach (config_file ${LAYER_JSON_FILES})
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/windows/${config_file}.json src_json)
- FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/${config_file}.json dst_json)
+ FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${config_file}.json dst_json)
add_custom_target(${config_file}-json ALL
+ DEPENDS mk_layer_config_dir
COMMAND copy ${src_json} ${dst_json}
VERBATIM
)