瀏覽代碼

cmMakefile: check cmake script mode exit code after command

Which potentially may set it, and forward it to the cmExecutionStatus
for proper handling in caller.
leha-bot 1 年之前
父節點
當前提交
b62dcbf5d2
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      Source/cmMakefile.cxx

+ 6 - 0
Source/cmMakefile.cxx

@@ -529,6 +529,12 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
           cmSystemTools::SetFatalErrorOccurred();
           cmSystemTools::SetFatalErrorOccurred();
         }
         }
       }
       }
+      if (this->GetCMakeInstance()->HasScriptModeExitCode() &&
+          this->GetCMakeInstance()->GetWorkingMode() == cmake::SCRIPT_MODE) {
+        // pass-through the exit code from inner cmake_language(EXIT) ,
+        // possibly from include() or similar command...
+        status.SetExitCode(this->GetCMakeInstance()->GetScriptModeExitCode());
+      }
     }
     }
   } else {
   } else {
     if (!cmSystemTools::GetFatalErrorOccurred()) {
     if (!cmSystemTools::GetFatalErrorOccurred()) {