11cb0ef41Sopenharmony_ci// Copyright 2019 the V8 project authors. All rights reserved. 21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be 31cb0ef41Sopenharmony_ci// found in the LICENSE file. 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ci#include "third_party/protobuf/src/google/protobuf/compiler/command_line_interface.h" 61cb0ef41Sopenharmony_ci#include "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.h" 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_cinamespace v8 { 91cb0ef41Sopenharmony_cinamespace internal { 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_ciint ProtobufCompilerMain(int argc, char* argv[]) { 121cb0ef41Sopenharmony_ci google::protobuf::compiler::CommandLineInterface cli; 131cb0ef41Sopenharmony_ci cli.AllowPlugins("protoc-"); 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_ci // Proto2 C++ 161cb0ef41Sopenharmony_ci google::protobuf::compiler::cpp::CppGenerator cpp_generator; 171cb0ef41Sopenharmony_ci cli.RegisterGenerator("--cpp_out", "--cpp_opt", &cpp_generator, 181cb0ef41Sopenharmony_ci "Generate C++ header and source."); 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_ci return cli.Run(argc, argv); 211cb0ef41Sopenharmony_ci} 221cb0ef41Sopenharmony_ci 231cb0ef41Sopenharmony_ci} // namespace internal 241cb0ef41Sopenharmony_ci} // namespace v8 251cb0ef41Sopenharmony_ci 261cb0ef41Sopenharmony_ciint main(int argc, char* argv[]) { 271cb0ef41Sopenharmony_ci return v8::internal::ProtobufCompilerMain(argc, argv); 281cb0ef41Sopenharmony_ci} 29