Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: third_party/protobuf/BUILD.gn

Issue 1923733002: Split protoc into library and executable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update public deps Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/protobuf/protobuf.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 config("protobuf_config") { 5 config("protobuf_config") {
6 include_dirs = [ "src" ] 6 include_dirs = [ "src" ]
7 defines = [ 7 defines = [
8 "GOOGLE_PROTOBUF_NO_RTTI", 8 "GOOGLE_PROTOBUF_NO_RTTI",
9 "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER", 9 "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
10 ] 10 ]
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 322
323 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 323 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
324 "//build/config/compiler:no_size_t_to_int_warning", 324 "//build/config/compiler:no_size_t_to_int_warning",
325 ] 325 ]
326 326
327 cflags = protobuf_lite_cflags 327 cflags = protobuf_lite_cflags
328 } 328 }
329 329
330 # Only compile the compiler for the host architecture. 330 # Only compile the compiler for the host architecture.
331 if (current_toolchain == host_toolchain) { 331 if (current_toolchain == host_toolchain) {
332 executable("protoc") { 332 source_set("protoc_lib") {
333 sources = [ 333 sources = [
334 "src/google/protobuf/compiler/code_generator.cc", 334 "src/google/protobuf/compiler/code_generator.cc",
335 "src/google/protobuf/compiler/code_generator.h", 335 "src/google/protobuf/compiler/code_generator.h",
336 "src/google/protobuf/compiler/command_line_interface.cc", 336 "src/google/protobuf/compiler/command_line_interface.cc",
337 "src/google/protobuf/compiler/command_line_interface.h", 337 "src/google/protobuf/compiler/command_line_interface.h",
338 "src/google/protobuf/compiler/cpp/cpp_enum.cc", 338 "src/google/protobuf/compiler/cpp/cpp_enum.cc",
339 "src/google/protobuf/compiler/cpp/cpp_enum.h", 339 "src/google/protobuf/compiler/cpp/cpp_enum.h",
340 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", 340 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
341 "src/google/protobuf/compiler/cpp/cpp_enum_field.h", 341 "src/google/protobuf/compiler/cpp/cpp_enum_field.h",
342 "src/google/protobuf/compiler/cpp/cpp_extension.cc", 342 "src/google/protobuf/compiler/cpp/cpp_extension.cc",
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 "src/google/protobuf/compiler/javanano/javanano_map_field.cc", 469 "src/google/protobuf/compiler/javanano/javanano_map_field.cc",
470 "src/google/protobuf/compiler/javanano/javanano_map_field.h", 470 "src/google/protobuf/compiler/javanano/javanano_map_field.h",
471 "src/google/protobuf/compiler/javanano/javanano_message.cc", 471 "src/google/protobuf/compiler/javanano/javanano_message.cc",
472 "src/google/protobuf/compiler/javanano/javanano_message.h", 472 "src/google/protobuf/compiler/javanano/javanano_message.h",
473 "src/google/protobuf/compiler/javanano/javanano_message_field.cc", 473 "src/google/protobuf/compiler/javanano/javanano_message_field.cc",
474 "src/google/protobuf/compiler/javanano/javanano_message_field.h", 474 "src/google/protobuf/compiler/javanano/javanano_message_field.h",
475 "src/google/protobuf/compiler/javanano/javanano_primitive_field.cc", 475 "src/google/protobuf/compiler/javanano/javanano_primitive_field.cc",
476 "src/google/protobuf/compiler/javanano/javanano_primitive_field.h", 476 "src/google/protobuf/compiler/javanano/javanano_primitive_field.h",
477 "src/google/protobuf/compiler/js/js_generator.cc", 477 "src/google/protobuf/compiler/js/js_generator.cc",
478 "src/google/protobuf/compiler/js/js_generator.h", 478 "src/google/protobuf/compiler/js/js_generator.h",
479 "src/google/protobuf/compiler/main.cc",
480 "src/google/protobuf/compiler/objectivec/objectivec_enum.cc", 479 "src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
481 "src/google/protobuf/compiler/objectivec/objectivec_enum.h", 480 "src/google/protobuf/compiler/objectivec/objectivec_enum.h",
482 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", 481 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
483 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.h", 482 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.h",
484 "src/google/protobuf/compiler/objectivec/objectivec_extension.cc", 483 "src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
485 "src/google/protobuf/compiler/objectivec/objectivec_extension.h", 484 "src/google/protobuf/compiler/objectivec/objectivec_extension.h",
486 "src/google/protobuf/compiler/objectivec/objectivec_field.cc", 485 "src/google/protobuf/compiler/objectivec/objectivec_field.cc",
487 "src/google/protobuf/compiler/objectivec/objectivec_field.h", 486 "src/google/protobuf/compiler/objectivec/objectivec_field.h",
488 "src/google/protobuf/compiler/objectivec/objectivec_file.cc", 487 "src/google/protobuf/compiler/objectivec/objectivec_file.cc",
489 "src/google/protobuf/compiler/objectivec/objectivec_file.h", 488 "src/google/protobuf/compiler/objectivec/objectivec_file.h",
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 520
522 # Must be after no_chromium_code for warning flags to be ordered 521 # Must be after no_chromium_code for warning flags to be ordered
523 # correctly. 522 # correctly.
524 ":protobuf_warnings", 523 ":protobuf_warnings",
525 ] 524 ]
526 if (is_win) { 525 if (is_win) {
527 # This is defined internally, don't warn on duplicate. 526 # This is defined internally, don't warn on duplicate.
528 configs -= [ "//build/config/win:lean_and_mean" ] 527 configs -= [ "//build/config/win:lean_and_mean" ]
529 } 528 }
530 529
530 public_configs = [ ":protobuf_config" ]
531
532 cflags = protobuf_lite_cflags
533
534 public_deps = [
535 ":protobuf_full",
536 ]
537 }
538
539 executable("protoc") {
540 sources = [
541 "src/google/protobuf/compiler/main.cc",
542 ]
543
544 configs -= [ "//build/config/compiler:chromium_code" ]
545 configs += ["//build/config/compiler:no_chromium_code"]
546
531 cflags = protobuf_lite_cflags 547 cflags = protobuf_lite_cflags
532 548
533 deps = [ 549 deps = [
534 ":protobuf_full", 550 ":protoc_lib",
535 "//build/config/sanitizers:deps",
536 551
537 # Default manifest on Windows (a no-op elsewhere). 552 # Default manifest on Windows (a no-op elsewhere).
538 "//build/win:default_exe_manifest", 553 "//build/win:default_exe_manifest",
539 ] 554 ]
540 deps += [ "//build/config/sanitizers:deps" ]
541 } 555 }
542 } 556 }
543 557
544 google_python_dir = "$root_out_dir/pyproto/google" 558 google_python_dir = "$root_out_dir/pyproto/google"
545 559
546 copy("copy_google") { 560 copy("copy_google") {
547 sources = [ 561 sources = [
548 "__init__.py", 562 "__init__.py",
549 ] 563 ]
550 outputs = [ 564 outputs = [
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 ":copy_google_protobuf_internal", 631 ":copy_google_protobuf_internal",
618 ":copy_six", 632 ":copy_six",
619 ] 633 ]
620 634
621 # Targets that depend on this should depend on the copied data files. 635 # Targets that depend on this should depend on the copied data files.
622 data = get_target_outputs(":copy_google") 636 data = get_target_outputs(":copy_google")
623 data += get_target_outputs(":copy_six") 637 data += get_target_outputs(":copy_six")
624 data += get_target_outputs(":copy_google_protobuf") 638 data += get_target_outputs(":copy_google_protobuf")
625 data += get_target_outputs(":copy_google_protobuf_internal") 639 data += get_target_outputs(":copy_google_protobuf_internal")
626 } 640 }
OLDNEW
« no previous file with comments | « no previous file | third_party/protobuf/protobuf.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698