瀏覽代碼

BUG: Do not clean the .pdb file for a target just before it is linked! This finishes addressing bug#4341.

Brad King 19 年之前
父節點
當前提交
ed7de15676
共有 2 個文件被更改,包括 13 次插入4 次删除
  1. 8 3
      Source/cmMakefileExecutableTargetGenerator.cxx
  2. 5 1
      Source/cmMakefileLibraryTargetGenerator.cxx

+ 8 - 3
Source/cmMakefileExecutableTargetGenerator.cxx

@@ -293,9 +293,14 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
                                           cmLocalGenerator::START_OUTPUT,
                                           cmLocalGenerator::UNCHANGED));
     }
-  exeCleanFiles.push_back(this->Convert(cleanFullPDBName.c_str(),
-                                        cmLocalGenerator::START_OUTPUT,
-                                        cmLocalGenerator::UNCHANGED));
+
+  // List the PDB for cleaning only when the whole target is
+  // cleaned.  We do not want to delete the .pdb file just before
+  // linking the target.
+  this->CleanFiles.push_back
+    (this->Convert(cleanFullPDBName.c_str(),
+                   cmLocalGenerator::START_OUTPUT,
+                   cmLocalGenerator::UNCHANGED));
   }
 
   // Add a command to remove any existing files for this executable.

+ 5 - 1
Source/cmMakefileLibraryTargetGenerator.cxx

@@ -401,7 +401,11 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
           cmLocalGenerator::START_OUTPUT,
           cmLocalGenerator::UNCHANGED));
       }
-    libCleanFiles.push_back
+
+    // List the PDB for cleaning only when the whole target is
+    // cleaned.  We do not want to delete the .pdb file just before
+    // linking the target.
+    this->CleanFiles.push_back
       (this->Convert(cleanFullPDBName.c_str(),
                      cmLocalGenerator::START_OUTPUT,
                      cmLocalGenerator::UNCHANGED));