diff options
author | Brad King <brad.king@kitware.com> | 2018-01-25 13:35:23 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-01-25 13:35:28 (GMT) |
commit | 5c724c4ca83059b13e6fd64dad9ee88f59162166 (patch) | |
tree | 09a42c3d5fe1c127386160a830fa693e39de6a86 /Source | |
parent | aaf3c5b32c9e75fb738fcc00228551f678db26d5 (diff) | |
parent | 239a3ef8215416d3fa7d7c1b0bf812b17b3437df (diff) | |
download | CMake-5c724c4ca83059b13e6fd64dad9ee88f59162166.zip CMake-5c724c4ca83059b13e6fd64dad9ee88f59162166.tar.gz CMake-5c724c4ca83059b13e6fd64dad9ee88f59162166.tar.bz2 |
Merge topic 'server-polish-opt-handshake'
239a3ef8 Server-mode: Document protocol version for optional handshake arguments
9b1a3d24 Server-mode: Rename functions to reflect what they do
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1693
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmServerProtocol.cxx | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index c2dee8f..371d536 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -266,8 +266,8 @@ static void setErrorMessage(std::string* errorMessage, const std::string& text) } } -static bool testHomeDirectory(cmState* state, std::string& value, - std::string* errorMessage) +static bool getOrTestHomeDirectory(cmState* state, std::string& value, + std::string* errorMessage) { const std::string cachedValue = std::string(state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY")); @@ -288,9 +288,10 @@ static bool testHomeDirectory(cmState* state, std::string& value, return true; } -static bool testValue(cmState* state, const std::string& key, - std::string& value, const std::string& keyDescription, - std::string* errorMessage) +static bool getOrTestValue(cmState* state, const std::string& key, + std::string& value, + const std::string& keyDescription, + std::string* errorMessage) { const char* entry = state->GetCacheEntryValue(key); const std::string cachedValue = @@ -337,31 +338,31 @@ bool cmServerProtocol1::DoActivate(const cmServerRequest& request, cmState* state = cm->GetState(); // Check generator: - if (!testValue(state, "CMAKE_GENERATOR", generator, "generator", - errorMessage)) { + if (!getOrTestValue(state, "CMAKE_GENERATOR", generator, "generator", + errorMessage)) { return false; } // check extra generator: - if (!testValue(state, "CMAKE_EXTRA_GENERATOR", extraGenerator, - "extra generator", errorMessage)) { + if (!getOrTestValue(state, "CMAKE_EXTRA_GENERATOR", extraGenerator, + "extra generator", errorMessage)) { return false; } // check sourcedir: - if (!testHomeDirectory(state, sourceDirectory, errorMessage)) { + if (!getOrTestHomeDirectory(state, sourceDirectory, errorMessage)) { return false; } // check toolset: - if (!testValue(state, "CMAKE_GENERATOR_TOOLSET", toolset, "toolset", - errorMessage)) { + if (!getOrTestValue(state, "CMAKE_GENERATOR_TOOLSET", toolset, "toolset", + errorMessage)) { return false; } // check platform: - if (!testValue(state, "CMAKE_GENERATOR_PLATFORM", platform, "platform", - errorMessage)) { + if (!getOrTestValue(state, "CMAKE_GENERATOR_PLATFORM", platform, + "platform", errorMessage)) { return false; } } |