summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2019-09-09 08:34:08 (GMT)
committerRolf Eike Beer <eb@emlix.com>2019-09-09 08:34:08 (GMT)
commit5b96fd5b81bde4655e471a31bf0fc579c1d10136 (patch)
tree13d9a3b24d84e1d15c4e1929c6c6224ae126675f /Source/cmLocalGenerator.cxx
parent5eaf1e1be289245267263536f5464e40d2a677c0 (diff)
downloadCMake-5b96fd5b81bde4655e471a31bf0fc579c1d10136.zip
CMake-5b96fd5b81bde4655e471a31bf0fc579c1d10136.tar.gz
CMake-5b96fd5b81bde4655e471a31bf0fc579c1d10136.tar.bz2
use cmSystemTools::MoveFileIfDifferent()
This is better than doing CopyFileIfDifferent() followed by RemoveFile() in two ways: - it is more efficient, as it avoids disk I/O for the data, even if the files here are usually small - it is atomic, so an abort during the copy will not leave a destination file with partial data behind
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 9152e94..3d8c3fb 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2275,8 +2275,7 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target,
}
}
}
- cmSystemTools::CopyFileIfDifferent(filename_tmp, filename);
- cmSystemTools::RemoveFile(filename_tmp);
+ cmSystemTools::MoveFileIfDifferent(filename_tmp, filename);
target->AddSource(filename, true);