diff options
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 936b282..6fb7734 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -529,6 +529,12 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, 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 { if (!cmSystemTools::GetFatalErrorOccurred()) { @@ -898,6 +904,11 @@ void cmMakefile::RunListFile(cmListFile const& listFile, if (cmSystemTools::GetFatalErrorOccurred()) { break; } + if (status.HasExitCode()) { + // cmake_language EXIT was requested, early break. + this->GetCMakeInstance()->SetScriptModeExitCode(status.GetExitCode()); + break; + } if (status.GetReturnInvoked()) { this->RaiseScope(status.GetReturnVariables()); // Exit early due to return command. |