1 // Copyright 2019 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "third_party/protobuf/src/google/protobuf/compiler/command_line_interface.h" 6 #include "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.h" 7 8 namespace v8 { 9 namespace internal { 10 ProtobufCompilerMain(int argc,char * argv[])11int ProtobufCompilerMain(int argc, char* argv[]) { 12 google::protobuf::compiler::CommandLineInterface cli; 13 cli.AllowPlugins("protoc-"); 14 15 // Proto2 C++ 16 google::protobuf::compiler::cpp::CppGenerator cpp_generator; 17 cli.RegisterGenerator("--cpp_out", "--cpp_opt", &cpp_generator, 18 "Generate C++ header and source."); 19 20 return cli.Run(argc, argv); 21 } 22 23 } // namespace internal 24 } // namespace v8 25 main(int argc,char * argv[])26int main(int argc, char* argv[]) { 27 return v8::internal::ProtobufCompilerMain(argc, argv); 28 } 29