From b62dcbf5d2f99dd5f258be9955df6ed605657f70 Mon Sep 17 00:00:00 2001 From: leha-bot Date: Fri, 5 Jan 2024 04:21:48 +0300 Subject: 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. --- Source/cmMakefile.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 36bd69b..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()) { -- cgit v0.12