cmState: Construct with mode

This commit is contained in:
Brad King
2021-07-02 14:12:45 -04:00
parent c9cd039e5f
commit 2065bd73cb
4 changed files with 13 additions and 19 deletions
+1 -1
View File
@@ -2165,7 +2165,7 @@ bool cmCTestTestHandler::SetTestsProperties(
// Ensure we have complete triples otherwise the data is corrupt.
if (triples.size() % 3 == 0) {
cmState state;
cmState state(cmState::Unknown);
rt.Backtrace = cmListFileBacktrace(state.CreateBaseSnapshot());
// the first entry represents the top of the trace so we need to
+4 -8
View File
@@ -26,7 +26,8 @@
#include "cmSystemTools.h"
#include "cmake.h"
cmState::cmState()
cmState::cmState(Mode mode)
: StateMode(mode)
{
this->CacheManager = cm::make_unique<cmCacheManager>();
this->GlobVerificationManager = cm::make_unique<cmGlobVerificationManager>();
@@ -771,17 +772,12 @@ unsigned int cmState::GetCacheMinorVersion() const
cmState::Mode cmState::GetMode() const
{
return this->CurrentMode;
return this->StateMode;
}
std::string cmState::GetModeString() const
{
return ModeToString(this->CurrentMode);
}
void cmState::SetMode(cmState::Mode mode)
{
this->CurrentMode = mode;
return ModeToString(this->StateMode);
}
std::string cmState::ModeToString(cmState::Mode mode)
+7 -8
View File
@@ -35,12 +35,6 @@ class cmState
friend class cmStateSnapshot;
public:
cmState();
~cmState();
cmState(const cmState&) = delete;
cmState& operator=(const cmState&) = delete;
enum Mode
{
Unknown,
@@ -51,6 +45,12 @@ public:
CPack,
};
cmState(Mode mode);
~cmState();
cmState(const cmState&) = delete;
cmState& operator=(const cmState&) = delete;
static const std::string& GetTargetTypeName(
cmStateEnums::TargetType targetType);
@@ -207,7 +207,6 @@ public:
Mode GetMode() const;
std::string GetModeString() const;
void SetMode(Mode mode);
static std::string ModeToString(Mode mode);
@@ -258,5 +257,5 @@ private:
bool NMake = false;
bool MSYSShell = false;
bool NinjaMulti = false;
Mode CurrentMode = Unknown;
Mode StateMode = Unknown;
};
+1 -2
View File
@@ -162,11 +162,10 @@ cmake::cmake(Role role, cmState::Mode mode)
#ifndef CMAKE_BOOTSTRAP
, VariableWatch(cm::make_unique<cmVariableWatch>())
#endif
, State(cm::make_unique<cmState>())
, State(cm::make_unique<cmState>(mode))
, Messenger(cm::make_unique<cmMessenger>())
{
this->TraceFile.close();
this->State->SetMode(mode);
this->CurrentSnapshot = this->State->CreateBaseSnapshot();
#ifdef __APPLE__