Commit 27523938 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[tracing] Only build protobuf generators for C++.

The default protobuf compiler main builds generators for the CLI tool
for all the supported languages.

This CL adds a custom main() which only requires the CPP generator.
The protobuf compiler is a build-time dependency so this won't shrink
binary size but will speed up compile a little bit and means we don't
have to list all of the files for the other supported languages in the
build.gn file. That should hopefully make protobuf rolls a bit easier
given that we are maintaining GN build files for protobuf.

Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
Bug: v8:8339
Change-Id: Iac432dfe53b7ac9cfa819be1b2945d5948ffff38
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1599448
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61317}
parent 78e2f3ff
...@@ -4521,69 +4521,8 @@ if (!build_with_chromium && v8_use_perfetto) { ...@@ -4521,69 +4521,8 @@ if (!build_with_chromium && v8_use_perfetto) {
"third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc", "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc",
"third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc", "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_enum.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_generator.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_message.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc",
"third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_context.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_doc_comment.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_enum.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_enum_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_enum_field_lite.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_extension.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_extension_lite.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_file.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_generator.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_generator_factory.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_map_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_map_field_lite.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_message.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_message_builder.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_message_builder_lite.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_message_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_message_field_lite.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_message_lite.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_name_resolver.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field_lite.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_service.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_shared_code_generator.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_string_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/java/java_string_field_lite.cc",
"third_party/protobuf/src/google/protobuf/compiler/js/js_generator.cc",
"third_party/protobuf/src/google/protobuf/compiler/js/well_known_types_embed.cc",
"third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
"third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
"third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.cc",
"third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_generator.cc",
"third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc",
"third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc",
"third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
"third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
"third_party/protobuf/src/google/protobuf/compiler/php/php_generator.cc",
"third_party/protobuf/src/google/protobuf/compiler/plugin.cc", "third_party/protobuf/src/google/protobuf/compiler/plugin.cc",
"third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc", "third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc",
"third_party/protobuf/src/google/protobuf/compiler/python/python_generator.cc",
"third_party/protobuf/src/google/protobuf/compiler/ruby/ruby_generator.cc",
"third_party/protobuf/src/google/protobuf/compiler/subprocess.cc", "third_party/protobuf/src/google/protobuf/compiler/subprocess.cc",
"third_party/protobuf/src/google/protobuf/compiler/zip_writer.cc", "third_party/protobuf/src/google/protobuf/compiler/zip_writer.cc",
] ]
...@@ -4601,7 +4540,7 @@ if (!build_with_chromium && v8_use_perfetto) { ...@@ -4601,7 +4540,7 @@ if (!build_with_chromium && v8_use_perfetto) {
"//build/win:default_exe_manifest", "//build/win:default_exe_manifest",
] ]
sources = [ sources = [
"third_party/protobuf/src/google/protobuf/compiler/main.cc", "src/protobuf/protobuf-compiler-main.cc",
] ]
configs -= [ "//build/config/compiler:chromium_code" ] configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ]
......
include_rules = [
"+third_party/protobuf/src/google/protobuf"
]
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/protobuf/src/google/protobuf/compiler/command_line_interface.h"
#include "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.h"
namespace v8 {
namespace internal {
int ProtobufCompilerMain(int argc, char* argv[]) {
google::protobuf::compiler::CommandLineInterface cli;
cli.AllowPlugins("protoc-");
// Proto2 C++
google::protobuf::compiler::cpp::CppGenerator cpp_generator;
cli.RegisterGenerator("--cpp_out", "--cpp_opt", &cpp_generator,
"Generate C++ header and source.");
return cli.Run(argc, argv);
}
} // namespace internal
} // namespace v8
int main(int argc, char* argv[]) {
return v8::internal::ProtobufCompilerMain(argc, argv);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment