浏览代码

Merge topic 'try_compile-nfs'

a9a258c302 try_compile: Do not try to remove '.nfs*' files

Acked-by: Kitware Robot <[email protected]>
Acked-by: Robert Maynard <[email protected]>
Acked-by: Axel Huebl <[email protected]>
Merge-request: !4913
Brad King 5 年之前
父节点
当前提交
43e8db481b
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      Source/cmCoreTryCompile.cxx

+ 3 - 1
Source/cmCoreTryCompile.cxx

@@ -956,7 +956,9 @@ void cmCoreTryCompile::CleanupFiles(std::string const& binDir)
   std::set<std::string> deletedFiles;
   for (unsigned long i = 0; i < dir.GetNumberOfFiles(); ++i) {
     const char* fileName = dir.GetFile(i);
-    if (strcmp(fileName, ".") != 0 && strcmp(fileName, "..") != 0) {
+    if (strcmp(fileName, ".") != 0 && strcmp(fileName, "..") != 0 &&
+        // Do not delete NFS temporary files.
+        !cmHasPrefix(fileName, ".nfs")) {
       if (deletedFiles.insert(fileName).second) {
         std::string const fullPath =
           std::string(binDir).append("/").append(fileName);