diff options
author | Brad King <brad.king@kitware.com> | 2024-02-13 21:45:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-02-14 13:51:48 (GMT) |
commit | 86698eea854bb779dd45f067a05fdad6068561e7 (patch) | |
tree | cdf8d903855cc85549078b30887180d1f9955b4f /Source | |
parent | a3033d1a063c0f9611c71738e9116f78d04daf97 (diff) | |
download | CMake-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')
-rw-r--r-- | Source/cmBlockCommand.cxx | 4 | ||||
-rw-r--r-- | Source/cmForEachCommand.cxx | 5 | ||||
-rw-r--r-- | Source/cmFunctionCommand.cxx | 4 | ||||
-rw-r--r-- | Source/cmIfCommand.cxx | 4 | ||||
-rw-r--r-- | Source/cmMacroCommand.cxx | 4 | ||||
-rw-r--r-- | Source/cmWhileCommand.cxx | 4 |
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; } |