mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
file(COPY_FILE): Add option to retry on Windows if input access fails
On Windows, a file may be inaccessible for a short time after it is created. This occurs for various reasons, including indexing, antivirus tools, and NTFS's asynchronous semantics. Add an `INPUT_MAY_BE_RECENT` option to tell CMake that the input file may have been recently created so that we can retry a few times to read it.
This commit is contained in:
@@ -149,6 +149,11 @@ public:
|
||||
Always,
|
||||
OnlyIfDifferent,
|
||||
};
|
||||
enum class CopyInputRecent
|
||||
{
|
||||
No,
|
||||
Yes,
|
||||
};
|
||||
enum class CopyResult
|
||||
{
|
||||
Success,
|
||||
@@ -179,6 +184,7 @@ public:
|
||||
/** Copy a file. */
|
||||
static CopyResult CopySingleFile(std::string const& oldname,
|
||||
std::string const& newname, CopyWhen when,
|
||||
CopyInputRecent inputRecent,
|
||||
std::string* err = nullptr);
|
||||
|
||||
enum class Replace
|
||||
|
||||
Reference in New Issue
Block a user