summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-02-15 17:57:34 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-02-15 17:57:56 (GMT)
commit1223c9a398e3592082139e8e18f557fe45c6427d (patch)
tree289f691c9cdb80fd64f37a5464bb2bc2af1ee0aa /Source
parentd7c600c9cd16284d266c20bd580fde95554c453f (diff)
parent86698eea854bb779dd45f067a05fdad6068561e7 (diff)
downloadCMake-1223c9a398e3592082139e8e18f557fe45c6427d.zip
CMake-1223c9a398e3592082139e8e18f557fe45c6427d.tar.gz
CMake-1223c9a398e3592082139e8e18f557fe45c6427d.tar.bz2
Merge topic 'cmake-language-exit-code' into release-3.29
86698eea85 cmake_language: Fix EXIT inside control flow blocks a3033d1a06 Tests: Remove unnecessary RunCMake.cmake_language expected result files Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Acked-by: Alex <leha-bot@yandex.ru> Merge-request: !9250
Diffstat (limited to 'Source')
-rw-r--r--Source/cmBlockCommand.cxx4
-rw-r--r--Source/cmForEachCommand.cxx5
-rw-r--r--Source/cmFunctionCommand.cxx4
-rw-r--r--Source/cmIfCommand.cxx4
-rw-r--r--Source/cmMacroCommand.cxx4
-rw-r--r--Source/cmWhileCommand.cxx4
6 files changed, 25 insertions, 0 deletions
diff --git a/Source/cmBlockCommand.cxx b/Source/cmBlockCommand.cxx
index 42f1ad3..5bf7bed 100644
--- a/Source/cmBlockCommand.cxx
+++ b/Source/cmBlockCommand.cxx
@@ -127,6 +127,10 @@ bool cmBlockFunctionBlocker::Replay(std::vector<cmListFileFunction> functions,
inStatus.SetContinueInvoked();
return true;
}
+ if (status.HasExitCode()) {
+ inStatus.SetExitCode(status.GetExitCode());
+ return true;
+ }
if (cmSystemTools::GetFatalErrorOccurred()) {
return true;
}
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 21a140d..33dae79 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -272,6 +272,11 @@ auto cmForEachFunctionBlocker::invoke(
if (status.GetContinueInvoked()) {
break;
}
+ if (status.HasExitCode()) {
+ inStatus.SetExitCode(status.GetExitCode());
+ result.Break = true;
+ break;
+ }
if (cmSystemTools::GetFatalErrorOccurred()) {
result.Restore = false;
result.Break = true;
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 8d2d972..33721fc 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -124,6 +124,10 @@ bool cmFunctionHelperCommand::operator()(
makefile.RaiseScope(status.GetReturnVariables());
break;
}
+ if (status.HasExitCode()) {
+ inStatus.SetExitCode(status.GetExitCode());
+ break;
+ }
}
// pop scope on the makefile
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index c2a09c1..0b80aaa 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -161,6 +161,10 @@ bool cmIfFunctionBlocker::Replay(std::vector<cmListFileFunction> functions,
inStatus.SetContinueInvoked();
return true;
}
+ if (status.HasExitCode()) {
+ inStatus.SetExitCode(status.GetExitCode());
+ return true;
+ }
}
}
return true;
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 3d7cd8b..b57c3dd 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -135,6 +135,10 @@ bool cmMacroHelperCommand::operator()(
inStatus.SetBreakInvoked();
return true;
}
+ if (status.HasExitCode()) {
+ inStatus.SetExitCode(status.GetExitCode());
+ return true;
+ }
}
return true;
}
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index e80d1fc..6b454d7 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -105,6 +105,10 @@ bool cmWhileFunctionBlocker::Replay(std::vector<cmListFileFunction> functions,
if (status.GetContinueInvoked()) {
break;
}
+ if (status.HasExitCode()) {
+ inStatus.SetExitCode(status.GetExitCode());
+ return true;
+ }
if (cmSystemTools::GetFatalErrorOccurred()) {
return true;
}