From 6e2e187e31c0f91eeee6cce5da7a8310a1696dd2 Mon Sep 17 00:00:00 2001 From: Esteban Papp Date: Fri, 11 Jun 2021 18:52:03 -0700 Subject: [PATCH] improve incremental --- .../Mac/runtime_dependencies_mac.cmake.in | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in index 8a88df86cb..58bac188fd 100644 --- a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in +++ b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in @@ -72,6 +72,7 @@ function(ly_copy source_file target_directory) file(LOCK "${CMAKE_BINARY_DIR}/runtimedependencies.lock" GUARD FUNCTION TIMEOUT 30) message(STATUS "Copying \"${source_file}\" to \"${target_directory}\"...") file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN) + file(TOUCH ${target_directory}/${target_filename}) set(anything_new TRUE PARENT_SCOPE) endif() endif() @@ -85,26 +86,18 @@ endif() if(@target_file_dir@ MATCHES ".app/Contents/MacOS") string(REGEX REPLACE "(.*\\.app)/Contents/MacOS.*" "\\1" bundle_path "@target_file_dir@") + set(fixup_timestamp_file "${bundle_path}.fixup.stamp") if(NOT anything_new) - set(timestamp_file "${bundle_path}.fixup.stamp") - if(NOT EXISTS "${timestamp_file}") + if(NOT EXISTS "${fixup_timestamp_file}" OR "${bundle_path}" IS_NEWER_THAN "${fixup_timestamp_file}") set(anything_new TRUE) - else() - file(GLOB_RECURSE files_in_bundle FOLLOW_SYMLINKS "${bundle_path}") - foreach(file ${files_in_bundle}) - if(${file} IS_NEWER_THAN "${timestamp_file}") - set(anything_new TRUE) - break() - endif() - endforeach() endif() endif() if(anything_new) # LYN-4505: Patch dxc, is configured in the wrong folder in 3p if(EXISTS ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7) - file(RENAME - ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/lib/libdxcompiler.3.7.dylib - ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/libdxcompiler.3.7.dylib + # we copy to not invalidate the copy check from above + file(COPY ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/lib/libdxcompiler.3.7.dylib + DESTINATION ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin ) endif() if(EXISTS ${bundle_path}/Contents/Frameworks/Python.framework) @@ -134,6 +127,7 @@ if(@target_file_dir@ MATCHES ".app/Contents/MacOS") list(REMOVE_DUPLICATES plugin_libs) list(REMOVE_DUPLICATES plugin_dirs) fixup_bundle("${bundle_path}" "${plugin_libs}" "${plugin_dirs}") - file(TOUCH "${timestamp_file}") + file(TOUCH "${bundle_path}") + file(TOUCH "${fixup_timestamp_file}") endif() endif()