mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-12 23:43:59 +03:00
cmExecutionStatus: Add ability to set optional custom exit code
This commit is contained in:
1 parent
a68d899874
commit
1082b9cb9a
1 file changed
+8
@@ -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;
|
||||
};
|
||||
Reference in new issue
Block a user