summaryrefslogtreecommitdiffstats
path: root/Source/cmServerProtocol.cxx
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2016-10-27 09:48:31 (GMT)
committerTobias Hunger <tobias.hunger@qt.io>2016-10-28 11:46:15 (GMT)
commit42ccbee11c1b3be12c5ebb9f69cb769d79d491ad (patch)
tree5ea61e368e6575b9ec5ef69be7dc7ac71f74d45f /Source/cmServerProtocol.cxx
parentd792491c405ce47bcd779f53fa0f9422bb3df494 (diff)
downloadCMake-42ccbee11c1b3be12c5ebb9f69cb769d79d491ad.zip
CMake-42ccbee11c1b3be12c5ebb9f69cb769d79d491ad.tar.gz
CMake-42ccbee11c1b3be12c5ebb9f69cb769d79d491ad.tar.bz2
server-mode: Handle generator toolset and platform in handshake
Diffstat (limited to 'Source/cmServerProtocol.cxx')
-rw-r--r--Source/cmServerProtocol.cxx31
1 files changed, 30 insertions, 1 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index f3ecfaa..09b08fe 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -259,7 +259,7 @@ static bool testValue(cmState* state, const std::string& key,
if (!cachedValue.empty() && !value.empty() && cachedValue != value) {
setErrorMessage(errorMessage, std::string("\"") + key +
"\" is set but incompatible with configured " +
- keyDescription + "value.");
+ keyDescription + " value.");
return false;
}
if (value.empty()) {
@@ -276,6 +276,8 @@ bool cmServerProtocol1_0::DoActivate(const cmServerRequest& request,
request.Data[kBUILD_DIRECTORY_KEY].asString();
std::string generator = request.Data[kGENERATOR_KEY].asString();
std::string extraGenerator = request.Data[kEXTRA_GENERATOR_KEY].asString();
+ std::string toolset = request.Data[kTOOLSET_KEY].asString();
+ std::string platform = request.Data[kPLATFORM_KEY].asString();
if (buildDirectory.empty()) {
setErrorMessage(errorMessage, std::string("\"") + kBUILD_DIRECTORY_KEY +
@@ -312,6 +314,18 @@ bool cmServerProtocol1_0::DoActivate(const cmServerRequest& request,
"source directory", errorMessage)) {
return false;
}
+
+ // check toolset:
+ if (!testValue(state, "CMAKE_GENERATOR_TOOLSET", toolset, "toolset",
+ errorMessage)) {
+ return false;
+ }
+
+ // check platform:
+ if (!testValue(state, "CMAKE_GENERATOR_PLATFORM", platform, "platform",
+ errorMessage)) {
+ return false;
+ }
}
}
@@ -354,11 +368,26 @@ bool cmServerProtocol1_0::DoActivate(const cmServerRequest& request,
"\" is not supported."));
return false;
}
+ if (!extraIt->supportsToolset && !toolset.empty()) {
+ setErrorMessage(errorMessage,
+ std::string("Toolset was provided but is not supported by "
+ "the requested generator."));
+ return false;
+ }
+ if (!extraIt->supportsPlatform && !platform.empty()) {
+ setErrorMessage(errorMessage,
+ std::string("Platform was provided but is not supported "
+ "by the requested generator."));
+ return false;
+ }
const std::string fullGeneratorName =
cmExternalMakefileProjectGenerator::CreateFullGeneratorName(
generator, extraGenerator);
+ cm->SetGeneratorToolset(toolset);
+ cm->SetGeneratorPlatform(platform);
+
cmGlobalGenerator* gg = cm->CreateGlobalGenerator(fullGeneratorName);
if (!gg) {
setErrorMessage(