diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2016-09-09 08:01:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-20 12:32:26 (GMT) |
commit | 7df8a8f2769de784c24dc6baeb55ad2038aa059f (patch) | |
tree | 3b2535b239d205da500802c7f427f8a37fbf89d3 /Source/cmcmd.cxx | |
parent | 5c87b92b1b7888ee032e3c2a75f35f1f94f4dfa5 (diff) | |
download | CMake-7df8a8f2769de784c24dc6baeb55ad2038aa059f.zip CMake-7df8a8f2769de784c24dc6baeb55ad2038aa059f.tar.gz CMake-7df8a8f2769de784c24dc6baeb55ad2038aa059f.tar.bz2 |
server-mode: Add --experimental flag
Allow for experimental cmProtocolVersions, which will only ever get
listed if the server was started with the (undocumented)
"--experimental" flag.
Mark current protocol version 1.0 as experimental.
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r-- | Source/cmcmd.cxx | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index c09ea8b..38f00e6 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -913,15 +913,32 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) } return 0; } else if (args[1] == "server") { - if (args.size() > 2) { + if (args.size() > 3) { cmSystemTools::Error("Too many arguments to start server mode"); return 1; } + bool supportExperimental = false; + if (args.size() == 3) { + if (args[2] == "--experimental") { + supportExperimental = true; + } else { + cmSystemTools::Error("Unknown argument for server mode"); + return 1; + } + } #if defined(HAVE_SERVER_MODE) && HAVE_SERVER_MODE - cmServer server; - server.Serve(); - return 0; + cmServer server(supportExperimental); + if (server.Serve()) { + return 0; + } else { + cmSystemTools::Error( + "CMake server could not find any supported protocol. " + "Try with \"--experimental\" to enable " + "experimental support."); + return 1; + } #else + static_cast<void>(supportExperimental); cmSystemTools::Error("CMake was not built with server mode enabled"); return 1; #endif |