[Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-793-gfd04f8c

Brad King brad.king at kitware.com
Fri Oct 28 08:26:15 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  fd04f8cf253bfea097ba9e3021fa6a55c2fbc718 (commit)
       via  42ccbee11c1b3be12c5ebb9f69cb769d79d491ad (commit)
      from  d79b8e85700981667f30e1b35ee9ba1b3c323ce5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd04f8cf253bfea097ba9e3021fa6a55c2fbc718
commit fd04f8cf253bfea097ba9e3021fa6a55c2fbc718
Merge: d79b8e8 42ccbee
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Oct 28 08:26:14 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Oct 28 08:26:14 2016 -0400

    Merge topic 'cmake-server-handshake-improvements' into next
    
    42ccbee1 server-mode: Handle generator toolset and platform in handshake


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=42ccbee11c1b3be12c5ebb9f69cb769d79d491ad
commit 42ccbee11c1b3be12c5ebb9f69cb769d79d491ad
Author:     Tobias Hunger <tobias.hunger at qt.io>
AuthorDate: Thu Oct 27 11:48:31 2016 +0200
Commit:     Tobias Hunger <tobias.hunger at qt.io>
CommitDate: Fri Oct 28 13:46:15 2016 +0200

    server-mode: Handle generator toolset and platform in handshake

diff --git a/Help/manual/cmake-server.7.rst b/Help/manual/cmake-server.7.rst
index a72af14..9520cc1 100644
--- a/Help/manual/cmake-server.7.rst
+++ b/Help/manual/cmake-server.7.rst
@@ -276,7 +276,9 @@ Protocol version 1.0 requires the following attributes to be set:
   * "sourceDirectory" with a path to the sources
   * "buildDirectory" with a path to the build directory
   * "generator" with the generator name
-  * "extraGenerator" (optional!) with the extra generator to be used.
+  * "extraGenerator" (optional!) with the extra generator to be used
+  * "platform" with the generator platform (if supported by the generator)
+  * "toolset" with the generator toolset (if supported by the generator)
 
 Example::
 
diff --git a/Source/cmServerDictionary.h b/Source/cmServerDictionary.h
index 2d64cbd..e6a7ae6 100644
--- a/Source/cmServerDictionary.h
+++ b/Source/cmServerDictionary.h
@@ -62,6 +62,7 @@ static const std::string kMESSAGE_KEY = "message";
 static const std::string kMINOR_KEY = "minor";
 static const std::string kNAME_KEY = "name";
 static const std::string kPATH_KEY = "path";
+static const std::string kPLATFORM_KEY = "platform";
 static const std::string kPROGRESS_CURRENT_KEY = "progressCurrent";
 static const std::string kPROGRESS_MAXIMUM_KEY = "progressMaximum";
 static const std::string kPROGRESS_MESSAGE_KEY = "progressMessage";
@@ -77,6 +78,7 @@ static const std::string kSUPPORTED_PROTOCOL_VERSIONS =
 static const std::string kSYSROOT_KEY = "sysroot";
 static const std::string kTARGETS_KEY = "targets";
 static const std::string kTITLE_KEY = "title";
+static const std::string kTOOLSET_KEY = "toolset";
 static const std::string kTRACE_EXPAND_KEY = "traceExpand";
 static const std::string kTRACE_KEY = "trace";
 static const std::string kTYPE_KEY = "type";
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(

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list