aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/command_line_interface.cc
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2016-12-02 20:54:35 -0800
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2016-12-05 17:44:39 -0800
commitced8f73ffc89880af353b2e0d8b5dd0c5f75267d (patch)
tree65afbb05bf96d1fb843c17d108686d73e46122c4 /src/google/protobuf/compiler/command_line_interface.cc
parent4280c2740300f414d95a5f282426f25f5b13e05d (diff)
Add version number to plugin protocol.
Diffstat (limited to 'src/google/protobuf/compiler/command_line_interface.cc')
-rw-r--r--src/google/protobuf/compiler/command_line_interface.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc
index 78ceb68c..bef0fe5a 100644
--- a/src/google/protobuf/compiler/command_line_interface.cc
+++ b/src/google/protobuf/compiler/command_line_interface.cc
@@ -1619,6 +1619,13 @@ bool CommandLineInterface::GeneratePluginOutput(
&already_seen, request.mutable_proto_file());
}
+ google::protobuf::compiler::Version* version =
+ request.mutable_compiler_version();
+ version->set_major(GOOGLE_PROTOBUF_VERSION / 1000000);
+ version->set_minor(GOOGLE_PROTOBUF_VERSION / 1000 % 1000);
+ version->set_patch(GOOGLE_PROTOBUF_VERSION % 1000);
+ version->set_suffix(GOOGLE_PROTOBUF_VERSION_SUFFIX);
+
// Invoke the plugin.
Subprocess subprocess;