Browse Source

cmake --build: Consolidate role upgrade to reconfigure VS projects

Brad King 1 month ago
parent
commit
28610de96b
1 changed files with 21 additions and 24 deletions
  1. 21 24
      Source/cmake.cxx

+ 21 - 24
Source/cmake.cxx

@@ -4013,33 +4013,30 @@ int cmake::Build(int jobs, std::string dir, std::vector<std::string> targets,
     cmGlobalVisualStudio14Generator::GetGenerateStampList();
 
   // Note that the stampList file only exists for VS generators.
-  if (cmSystemTools::FileExists(stampList)) {
-
+  if (cmSystemTools::FileExists(stampList) &&
+      !cmakeCheckStampList(stampList)) {
     this->AddScriptingCommands();
+    this->AddProjectCommands();
 
-    if (!cmakeCheckStampList(stampList)) {
-      // Correctly initialize the home (=source) and home output (=binary)
-      // directories, which is required for running the generation step.
-      this->SetDirectoriesFromFile(cachePath);
-
-      this->AddProjectCommands();
+    // Correctly initialize the home (=source) and home output (=binary)
+    // directories, which is required for running the generation step.
+    this->SetDirectoriesFromFile(cachePath);
 
-      int ret = this->Configure();
-      if (ret) {
-        cmSystemTools::Message("CMake Configure step failed.  "
-                               "Build files cannot be regenerated correctly.");
-        return ret;
-      }
-      ret = this->Generate();
-      if (ret) {
-        cmSystemTools::Message("CMake Generate step failed.  "
-                               "Build files cannot be regenerated correctly.");
-        return ret;
-      }
-      std::string message = cmStrCat("Build files have been written to: ",
-                                     this->GetHomeOutputDirectory());
-      this->UpdateProgress(message, -1);
-    }
+    int ret = this->Configure();
+    if (ret) {
+      cmSystemTools::Message("CMake Configure step failed.  "
+                             "Build files cannot be regenerated correctly.");
+      return ret;
+    }
+    ret = this->Generate();
+    if (ret) {
+      cmSystemTools::Message("CMake Generate step failed.  "
+                             "Build files cannot be regenerated correctly.");
+      return ret;
+    }
+    std::string message = cmStrCat("Build files have been written to: ",
+                                   this->GetHomeOutputDirectory());
+    this->UpdateProgress(message, -1);
   }
 #endif