improve incremental

This commit is contained in:
Esteban Papp
2021-06-11 18:52:03 -07:00
committed by pappeste
parent 4a53d79158
commit 6e2e187e31
@@ -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()