diff options
author | leha-bot <leha-bot@yandex.ru> | 2023-06-12 16:09:40 (GMT) |
---|---|---|
committer | leha-bot <leha-bot@yandex.ru> | 2024-01-16 07:41:31 (GMT) |
commit | 1082b9cb9a51749dd24a866cc18798434c2eaff5 (patch) | |
tree | 3c96f5e8ca89910452d05dbfe9facfe17be06b30 /Source/cmExecutionStatus.h | |
parent | a68d899874d9a6cd9f961e7219bc7de27694ae4c (diff) | |
download | CMake-1082b9cb9a51749dd24a866cc18798434c2eaff5.zip CMake-1082b9cb9a51749dd24a866cc18798434c2eaff5.tar.gz CMake-1082b9cb9a51749dd24a866cc18798434c2eaff5.tar.bz2 |
cmExecutionStatus: Add ability to set optional custom exit code
Diffstat (limited to 'Source/cmExecutionStatus.h')
-rw-r--r-- | Source/cmExecutionStatus.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h index ced3548..e023971 100644 --- a/Source/cmExecutionStatus.h +++ b/Source/cmExecutionStatus.h @@ -7,6 +7,8 @@ #include <string> #include <vector> +#include <cm/optional> + class cmMakefile; /** \class cmExecutionStatus @@ -53,6 +55,11 @@ public: void SetNestedError() { this->NestedError = true; } bool GetNestedError() const { return this->NestedError; } + void SetExitCode(int code) noexcept { this->ExitCode = code; } + bool HasExitCode() const noexcept { return this->ExitCode.has_value(); } + void CleanExitCode() noexcept { this->ExitCode.reset(); } + int GetExitCode() const noexcept { return this->ExitCode.value_or(-1); } + private: cmMakefile& Makefile; std::string Error; @@ -60,5 +67,6 @@ private: bool BreakInvoked = false; bool ContinueInvoked = false; bool NestedError = false; + cm::optional<int> ExitCode; std::vector<std::string> Variables; }; |