From 437620348d782df074850cdb733395e5e06e6acf Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Fri, 20 Apr 2018 10:49:41 -0600 Subject: 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. --- layers/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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}/$) + 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}/$/${config_file}.json dst_json) + FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/$/${config_file}.json dst_json) add_custom_target(${config_file}-json ALL + DEPENDS mk_layer_config_dir COMMAND copy ${src_json} ${dst_json} VERBATIM ) -- cgit v1.2.3