summaryrefslogtreecommitdiffstats
path: root/Source/cmWhileCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-02-13 21:45:43 (GMT)
committerBrad King <brad.king@kitware.com>2024-02-14 13:51:48 (GMT)
commit86698eea854bb779dd45f067a05fdad6068561e7 (patch)
treecdf8d903855cc85549078b30887180d1f9955b4f /Source/cmWhileCommand.cxx
parenta3033d1a063c0f9611c71738e9116f78d04daf97 (diff)
downloadCMake-86698eea854bb779dd45f067a05fdad6068561e7.zip
CMake-86698eea854bb779dd45f067a05fdad6068561e7.tar.gz
CMake-86698eea854bb779dd45f067a05fdad6068561e7.tar.bz2
cmake_language: Fix EXIT inside control flow blocks
These were missed in commit 1bb1769235 (cmake_language: Add EXIT subcommand, 2024-01-05, v3.29.0-rc1~112^2). Fixes: #25674
Diffstat (limited to 'Source/cmWhileCommand.cxx')
-rw-r--r--Source/cmWhileCommand.cxx4
1 files changed, 4 insertions, 0 deletions
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;
}