Browse Source

cmGlobalGenerator: Abort generation earlier on export() error

Brad King 8 years ago
parent
commit
b1eb493c11
1 changed files with 5 additions and 4 deletions
  1. 5 4
      Source/cmGlobalGenerator.cxx

+ 5 - 4
Source/cmGlobalGenerator.cxx

@@ -1347,10 +1347,11 @@ void cmGlobalGenerator::Generate()
   for (std::map<std::string, cmExportBuildFileGenerator*>::iterator it =
   for (std::map<std::string, cmExportBuildFileGenerator*>::iterator it =
          this->BuildExportSets.begin();
          this->BuildExportSets.begin();
        it != this->BuildExportSets.end(); ++it) {
        it != this->BuildExportSets.end(); ++it) {
-    if (!it->second->GenerateImportFile() &&
-        !cmSystemTools::GetErrorOccuredFlag()) {
-      this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR,
-                                             "Could not write export file.");
+    if (!it->second->GenerateImportFile()) {
+      if (!cmSystemTools::GetErrorOccuredFlag()) {
+        this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR,
+                                               "Could not write export file.");
+      }
       return;
       return;
     }
     }
   }
   }