diff options
Diffstat (limited to 'Source/cmServerProtocol.cxx')
| -rw-r--r-- | Source/cmServerProtocol.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index 1d4ea01..4f7131f 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -10,16 +10,17 @@ #include <vector> #include <cm/memory> +#include <cmext/algorithm> -#include "cm_uv.h" +#include <cm3p/uv.h> -#include "cmAlgorithms.h" #include "cmExternalMakefileProjectGenerator.h" #include "cmFileMonitor.h" #include "cmGlobalGenerator.h" #include "cmJsonObjectDictionary.h" #include "cmJsonObjects.h" #include "cmMessageType.h" +#include "cmProperty.h" #include "cmServer.h" #include "cmServerDictionary.h" #include "cmState.h" @@ -182,7 +183,7 @@ static bool getOrTestHomeDirectory(cmState* state, std::string& value, std::string* errorMessage) { const std::string cachedValue = - std::string(state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY")); + *state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); if (value.empty()) { value = cachedValue; return true; @@ -205,9 +206,7 @@ static bool getOrTestValue(cmState* state, const std::string& key, const std::string& keyDescription, std::string* errorMessage) { - const char* entry = state->GetCacheEntryValue(key); - const std::string cachedValue = - entry == nullptr ? std::string() : std::string(entry); + const std::string cachedValue = state->GetSafeCacheEntryValue(key); if (value.empty()) { value = cachedValue; } @@ -435,7 +434,7 @@ cmServerResponse cmServerProtocol1::ProcessCache( keys = allKeys; } else { for (auto const& i : keys) { - if (!cmContains(allKeys, i)) { + if (!cm::contains(allKeys, i)) { return request.ReportError("Key \"" + i + "\" not found in cache."); } } @@ -446,13 +445,13 @@ cmServerResponse cmServerProtocol1::ProcessCache( entry[kKEY_KEY] = key; entry[kTYPE_KEY] = cmState::CacheEntryTypeToString(state->GetCacheEntryType(key)); - entry[kVALUE_KEY] = state->GetCacheEntryValue(key); + entry[kVALUE_KEY] = *state->GetCacheEntryValue(key); Json::Value props = Json::objectValue; bool haveProperties = false; for (auto const& prop : state->GetCacheEntryPropertyList(key)) { haveProperties = true; - props[prop] = state->GetCacheEntryProperty(key, prop); + props[prop] = *state->GetCacheEntryProperty(key, prop); } if (haveProperties) { entry[kPROPERTIES_KEY] = props; @@ -564,7 +563,7 @@ cmServerResponse cmServerProtocol1::ProcessConfigure( if (cm->LoadCache(buildDir)) { // build directory has been set up before - const std::string* cachedSourceDir = + cmProp cachedSourceDir = cm->GetState()->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY"); if (!cachedSourceDir) { return request.ReportError("No CMAKE_HOME_DIRECTORY found in cache."); @@ -574,7 +573,7 @@ cmServerResponse cmServerProtocol1::ProcessConfigure( cm->SetHomeDirectory(sourceDir); } - const std::string* cachedGenerator = + cmProp cachedGenerator = cm->GetState()->GetInitializedCacheValue("CMAKE_GENERATOR"); if (cachedGenerator) { if (gg && gg->GetName() != *cachedGenerator) { |
