diff --git a/cmake/3rdPartyPackages.cmake b/cmake/3rdPartyPackages.cmake index 9a632798e8..0d1667f0e1 100644 --- a/cmake/3rdPartyPackages.cmake +++ b/cmake/3rdPartyPackages.cmake @@ -529,6 +529,12 @@ function(ly_force_download_package package_name) execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ${temp_download_target} WORKING_DIRECTORY ${final_folder} COMMAND_ECHO STDOUT OUTPUT_VARIABLE unpack_result) + # For the runtime dependencies cases, we need the timestamps of the files coming from 3rdParty to be newer than the ones + # from the output so the new versions get copied over. The untar from the previous step preserves timestamps so they + # can produce binaries with older timestamps to the ones that are in the build output. + file(GLOB_RECURSE package_files LIST_DIRECTORIES false ${final_folder}/*) + file(TOUCH_NOCREATE ${package_files}) + if (NOT ${unpack_result} EQUAL 0) message(SEND_ERROR "ly_package: required package {package_name} could not be unpacked. Compile may fail! Enable LY_PACKAGE_DEBUG to debug.") return() diff --git a/cmake/Platform/Common/runtime_dependencies_common.cmake.in b/cmake/Platform/Common/runtime_dependencies_common.cmake.in index 9d23a73a26..104c20205c 100644 --- a/cmake/Platform/Common/runtime_dependencies_common.cmake.in +++ b/cmake/Platform/Common/runtime_dependencies_common.cmake.in @@ -15,6 +15,7 @@ function(ly_copy source_file target_directory) if("${source_file}" IS_NEWER_THAN "${target_directory}/${target_filename}") 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_NOCREATE ${target_directory}/${target_filename}) endif() endif() endfunction() diff --git a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in index 9f9006c4c0..9869871f85 100644 --- a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in +++ b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in @@ -125,7 +125,7 @@ function(ly_copy source_file target_directory) file(LOCK ${target_directory}/${target_filename}.lock GUARD FUNCTION TIMEOUT 300) endif() file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN) - file(TOUCH ${target_directory}/${target_filename}) + file(TOUCH_NOCREATE ${target_directory}/${target_filename}) set(anything_new TRUE PARENT_SCOPE) endif() endif()