mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-29 04:09:35 +03:00
ExternalData: Improve robustness on Windows to copy a data object to a file
When an external data object was recently created on disk, perhaps fetched by the current process or another process, it may be inaccessible on Windows for a short time. Tell our `file(COPY_FILE)` call to retry a few times to copy the object to the final file path. Hopefully this will resolve our long-standing spurious failures of the `Module.ExternalData` test on Windows.
This commit is contained in:
1 parent
efa9eec040
commit
d34986036f
1 file changed
+1
-1
@@ -945,7 +945,7 @@ function(_ExternalData_link_or_copy src dst)
|
||||
file(CREATE_LINK "${tgt}" "${tmp}" RESULT result COPY_ON_ERROR SYMBOLIC)
|
||||
else()
|
||||
# Create a copy.
|
||||
file(COPY_FILE "${src}" "${tmp}" RESULT result)
|
||||
file(COPY_FILE "${src}" "${tmp}" RESULT result INPUT_MAY_BE_RECENT)
|
||||
endif()
|
||||
if(result)
|
||||
file(REMOVE "${tmp}")
|
||||
|
||||
Reference in new issue
Block a user