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

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

Issue 1930173003: Reland: Split protoc into library and executable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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') | third_party/protobuf/protobuf.gyp » ('J')
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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 "src/google/protobuf/util/time_util.h", 299 "src/google/protobuf/util/time_util.h",
300 "src/google/protobuf/util/type_resolver.h", 300 "src/google/protobuf/util/type_resolver.h",
301 "src/google/protobuf/util/type_resolver_util.cc", 301 "src/google/protobuf/util/type_resolver_util.cc",
302 "src/google/protobuf/util/type_resolver_util.h", 302 "src/google/protobuf/util/type_resolver_util.h",
303 "src/google/protobuf/wire_format.cc", 303 "src/google/protobuf/wire_format.cc",
304 "src/google/protobuf/wire_format.h", 304 "src/google/protobuf/wire_format.h",
305 "src/google/protobuf/wrappers.pb.cc", 305 "src/google/protobuf/wrappers.pb.cc",
306 "src/google/protobuf/wrappers.pb.h", 306 "src/google/protobuf/wrappers.pb.h",
307 ] 307 ]
308 308
309 deps = [
310 "//build/config/sanitizers:deps",
Wez 2016/04/28 22:46:05 So there is no GYP equivalent of this required? D
xyzzyz 2016/04/28 22:56:56 It's this target that uses sanitizer interface, no
311 ]
312
309 configs -= [ "//build/config/compiler:chromium_code" ] 313 configs -= [ "//build/config/compiler:chromium_code" ]
310 configs += [ 314 configs += [
311 "//build/config/compiler:no_chromium_code", 315 "//build/config/compiler:no_chromium_code",
312 316
313 # Must be after no_chromium_code for warning flags to be ordered 317 # Must be after no_chromium_code for warning flags to be ordered
314 # correctly. 318 # correctly.
315 ":protobuf_warnings", 319 ":protobuf_warnings",
316 ] 320 ]
317 if (is_win) { 321 if (is_win) {
318 configs -= [ "//build/config/win:lean_and_mean" ] 322 configs -= [ "//build/config/win:lean_and_mean" ]
319 } 323 }
320 public_configs = [ 324 public_configs = [
321 ":protobuf_config", 325 ":protobuf_config",
322 326
323 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 327 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
324 "//build/config/compiler:no_size_t_to_int_warning", 328 "//build/config/compiler:no_size_t_to_int_warning",
325 ] 329 ]
326 330
327 cflags = protobuf_lite_cflags 331 cflags = protobuf_lite_cflags
328 } 332 }
329 333
330 # Only compile the compiler for the host architecture. 334 # Only compile the compiler for the host architecture.
331 if (current_toolchain == host_toolchain) { 335 if (current_toolchain == host_toolchain) {
332 executable("protoc") { 336 source_set("protoc_lib") {
Wez 2016/04/28 22:46:05 nit: protoc_sources, since it's a source-set? It
xyzzyz 2016/04/28 22:56:56 I'd rather keep it protoc_lib, to match the name i
333 sources = [ 337 sources = [
334 "src/google/protobuf/compiler/code_generator.cc", 338 "src/google/protobuf/compiler/code_generator.cc",
335 "src/google/protobuf/compiler/code_generator.h", 339 "src/google/protobuf/compiler/code_generator.h",
336 "src/google/protobuf/compiler/command_line_interface.cc", 340 "src/google/protobuf/compiler/command_line_interface.cc",
337 "src/google/protobuf/compiler/command_line_interface.h", 341 "src/google/protobuf/compiler/command_line_interface.h",
338 "src/google/protobuf/compiler/cpp/cpp_enum.cc", 342 "src/google/protobuf/compiler/cpp/cpp_enum.cc",
339 "src/google/protobuf/compiler/cpp/cpp_enum.h", 343 "src/google/protobuf/compiler/cpp/cpp_enum.h",
340 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", 344 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
341 "src/google/protobuf/compiler/cpp/cpp_enum_field.h", 345 "src/google/protobuf/compiler/cpp/cpp_enum_field.h",
342 "src/google/protobuf/compiler/cpp/cpp_extension.cc", 346 "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", 473 "src/google/protobuf/compiler/javanano/javanano_map_field.cc",
470 "src/google/protobuf/compiler/javanano/javanano_map_field.h", 474 "src/google/protobuf/compiler/javanano/javanano_map_field.h",
471 "src/google/protobuf/compiler/javanano/javanano_message.cc", 475 "src/google/protobuf/compiler/javanano/javanano_message.cc",
472 "src/google/protobuf/compiler/javanano/javanano_message.h", 476 "src/google/protobuf/compiler/javanano/javanano_message.h",
473 "src/google/protobuf/compiler/javanano/javanano_message_field.cc", 477 "src/google/protobuf/compiler/javanano/javanano_message_field.cc",
474 "src/google/protobuf/compiler/javanano/javanano_message_field.h", 478 "src/google/protobuf/compiler/javanano/javanano_message_field.h",
475 "src/google/protobuf/compiler/javanano/javanano_primitive_field.cc", 479 "src/google/protobuf/compiler/javanano/javanano_primitive_field.cc",
476 "src/google/protobuf/compiler/javanano/javanano_primitive_field.h", 480 "src/google/protobuf/compiler/javanano/javanano_primitive_field.h",
477 "src/google/protobuf/compiler/js/js_generator.cc", 481 "src/google/protobuf/compiler/js/js_generator.cc",
478 "src/google/protobuf/compiler/js/js_generator.h", 482 "src/google/protobuf/compiler/js/js_generator.h",
479 "src/google/protobuf/compiler/main.cc",
480 "src/google/protobuf/compiler/objectivec/objectivec_enum.cc", 483 "src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
481 "src/google/protobuf/compiler/objectivec/objectivec_enum.h", 484 "src/google/protobuf/compiler/objectivec/objectivec_enum.h",
482 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", 485 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
483 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.h", 486 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.h",
484 "src/google/protobuf/compiler/objectivec/objectivec_extension.cc", 487 "src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
485 "src/google/protobuf/compiler/objectivec/objectivec_extension.h", 488 "src/google/protobuf/compiler/objectivec/objectivec_extension.h",
486 "src/google/protobuf/compiler/objectivec/objectivec_field.cc", 489 "src/google/protobuf/compiler/objectivec/objectivec_field.cc",
487 "src/google/protobuf/compiler/objectivec/objectivec_field.h", 490 "src/google/protobuf/compiler/objectivec/objectivec_field.h",
488 "src/google/protobuf/compiler/objectivec/objectivec_file.cc", 491 "src/google/protobuf/compiler/objectivec/objectivec_file.cc",
489 "src/google/protobuf/compiler/objectivec/objectivec_file.h", 492 "src/google/protobuf/compiler/objectivec/objectivec_file.h",
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 524
522 # Must be after no_chromium_code for warning flags to be ordered 525 # Must be after no_chromium_code for warning flags to be ordered
523 # correctly. 526 # correctly.
524 ":protobuf_warnings", 527 ":protobuf_warnings",
525 ] 528 ]
526 if (is_win) { 529 if (is_win) {
527 # This is defined internally, don't warn on duplicate. 530 # This is defined internally, don't warn on duplicate.
528 configs -= [ "//build/config/win:lean_and_mean" ] 531 configs -= [ "//build/config/win:lean_and_mean" ]
529 } 532 }
530 533
534 public_configs = [ ":protobuf_config" ]
535
536 cflags = protobuf_lite_cflags
537
538 public_deps = [
539 ":protobuf_full",
540 ]
541 }
542
543 executable("protoc") {
544 sources = [
545 "src/google/protobuf/compiler/main.cc",
546 ]
547
548 configs -= [ "//build/config/compiler:chromium_code" ]
549 configs += [ "//build/config/compiler:no_chromium_code" ]
Wez 2016/04/28 22:46:05 I assume that these configs affect the protoc_lib
xyzzyz 2016/04/28 22:56:56 Sorry, I don't quite understand your question.
Wez 2016/04/28 23:00:04 These are compiler configurations - if you were bu
xyzzyz 2016/04/28 23:07:39 I'm not sure, I think they should work mostly the
Wez 2016/04/28 23:15:18 Gah! codereview caught me out again by eliding unc
550
531 cflags = protobuf_lite_cflags 551 cflags = protobuf_lite_cflags
532 552
533 deps = [ 553 deps = [
534 ":protobuf_full", 554 ":protoc_lib",
535 "//build/config/sanitizers:deps",
536 555
537 # Default manifest on Windows (a no-op elsewhere). 556 # Default manifest on Windows (a no-op elsewhere).
538 "//build/win:default_exe_manifest", 557 "//build/win:default_exe_manifest",
539 ] 558 ]
540 deps += [ "//build/config/sanitizers:deps" ]
541 } 559 }
542 } 560 }
543 561
544 google_python_dir = "$root_out_dir/pyproto/google" 562 google_python_dir = "$root_out_dir/pyproto/google"
545 563
546 copy("copy_google") { 564 copy("copy_google") {
547 sources = [ 565 sources = [
548 "__init__.py", 566 "__init__.py",
549 ] 567 ]
550 outputs = [ 568 outputs = [
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 ":copy_google_protobuf_internal", 635 ":copy_google_protobuf_internal",
618 ":copy_six", 636 ":copy_six",
619 ] 637 ]
620 638
621 # Targets that depend on this should depend on the copied data files. 639 # Targets that depend on this should depend on the copied data files.
622 data = get_target_outputs(":copy_google") 640 data = get_target_outputs(":copy_google")
623 data += get_target_outputs(":copy_six") 641 data += get_target_outputs(":copy_six")
624 data += get_target_outputs(":copy_google_protobuf") 642 data += get_target_outputs(":copy_google_protobuf")
625 data += get_target_outputs(":copy_google_protobuf_internal") 643 data += get_target_outputs(":copy_google_protobuf_internal")
626 } 644 }
OLDNEW
« no previous file with comments | « no previous file | third_party/protobuf/protobuf.gyp » ('j') | third_party/protobuf/protobuf.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698