summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-08-15 17:17:40 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-08-15 17:17:49 (GMT)
commitf2cab9855bf5a041379e3a5bbdd26ca3ddeab87a (patch)
tree118a75ed68bd3b4fc852050e22752cad5126059d /Source
parent8cfd52981d70bb0219fb23118b35a50faf320022 (diff)
parent9b3c5ccf1200e237c0bad3336235b9dde289f016 (diff)
downloadCMake-f2cab9855bf5a041379e3a5bbdd26ca3ddeab87a.zip
CMake-f2cab9855bf5a041379e3a5bbdd26ca3ddeab87a.tar.gz
CMake-f2cab9855bf5a041379e3a5bbdd26ca3ddeab87a.tar.bz2
Merge topic 'server-allow-cache'
9b3c5ccf Server: test cache after reconnect 1df38758 cmServerProtocol: allow 'cache' request before 'configure' 187332b2 cmServerProtocol: fix test of empty values Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !977
Diffstat (limited to 'Source')
-rw-r--r--Source/cmServerProtocol.cxx19
1 files changed, 8 insertions, 11 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index 7a841a8..b371e9e 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -269,6 +269,10 @@ static bool testHomeDirectory(cmState* state, std::string& value,
{
const std::string cachedValue =
std::string(state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"));
+ if (value.empty()) {
+ value = cachedValue;
+ return true;
+ }
const std::string suffix = "/CMakeLists.txt";
const std::string cachedValueCML = cachedValue + suffix;
const std::string valueCML = value + suffix;
@@ -279,9 +283,6 @@ static bool testHomeDirectory(cmState* state, std::string& value,
"source directory value."));
return false;
}
- if (value.empty()) {
- value = cachedValue;
- }
return true;
}
@@ -292,15 +293,15 @@ static bool testValue(cmState* state, const std::string& key,
const char* entry = state->GetCacheEntryValue(key);
const std::string cachedValue =
entry == nullptr ? std::string() : std::string(entry);
- if (!cachedValue.empty() && !value.empty() && cachedValue != value) {
+ if (value.empty()) {
+ value = cachedValue;
+ }
+ if (!cachedValue.empty() && cachedValue != value) {
setErrorMessage(errorMessage, std::string("\"") + key +
"\" is set but incompatible with configured " +
keyDescription + " value.");
return false;
}
- if (value.empty()) {
- value = cachedValue;
- }
return true;
}
@@ -489,10 +490,6 @@ bool cmServerProtocol1::IsExperimental() const
cmServerResponse cmServerProtocol1::ProcessCache(
const cmServerRequest& request)
{
- if (this->m_State < STATE_CONFIGURED) {
- return request.ReportError("This project was not configured yet.");
- }
-
cmState* state = this->CMakeInstance()->GetState();
Json::Value result = Json::objectValue;