OLD | NEW |
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 Loading... |
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", |
| 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 # protoc compiler is separated into protoc library and executable targets to |
| 337 # support protoc plugins that need to link libprotoc, but not the main() |
| 338 # itself. See src/google/protobuf/compiler/plugin.h |
| 339 source_set("protoc_lib") { |
333 sources = [ | 340 sources = [ |
334 "src/google/protobuf/compiler/code_generator.cc", | 341 "src/google/protobuf/compiler/code_generator.cc", |
335 "src/google/protobuf/compiler/code_generator.h", | 342 "src/google/protobuf/compiler/code_generator.h", |
336 "src/google/protobuf/compiler/command_line_interface.cc", | 343 "src/google/protobuf/compiler/command_line_interface.cc", |
337 "src/google/protobuf/compiler/command_line_interface.h", | 344 "src/google/protobuf/compiler/command_line_interface.h", |
338 "src/google/protobuf/compiler/cpp/cpp_enum.cc", | 345 "src/google/protobuf/compiler/cpp/cpp_enum.cc", |
339 "src/google/protobuf/compiler/cpp/cpp_enum.h", | 346 "src/google/protobuf/compiler/cpp/cpp_enum.h", |
340 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", | 347 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", |
341 "src/google/protobuf/compiler/cpp/cpp_enum_field.h", | 348 "src/google/protobuf/compiler/cpp/cpp_enum_field.h", |
342 "src/google/protobuf/compiler/cpp/cpp_extension.cc", | 349 "src/google/protobuf/compiler/cpp/cpp_extension.cc", |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 "src/google/protobuf/compiler/javanano/javanano_map_field.cc", | 476 "src/google/protobuf/compiler/javanano/javanano_map_field.cc", |
470 "src/google/protobuf/compiler/javanano/javanano_map_field.h", | 477 "src/google/protobuf/compiler/javanano/javanano_map_field.h", |
471 "src/google/protobuf/compiler/javanano/javanano_message.cc", | 478 "src/google/protobuf/compiler/javanano/javanano_message.cc", |
472 "src/google/protobuf/compiler/javanano/javanano_message.h", | 479 "src/google/protobuf/compiler/javanano/javanano_message.h", |
473 "src/google/protobuf/compiler/javanano/javanano_message_field.cc", | 480 "src/google/protobuf/compiler/javanano/javanano_message_field.cc", |
474 "src/google/protobuf/compiler/javanano/javanano_message_field.h", | 481 "src/google/protobuf/compiler/javanano/javanano_message_field.h", |
475 "src/google/protobuf/compiler/javanano/javanano_primitive_field.cc", | 482 "src/google/protobuf/compiler/javanano/javanano_primitive_field.cc", |
476 "src/google/protobuf/compiler/javanano/javanano_primitive_field.h", | 483 "src/google/protobuf/compiler/javanano/javanano_primitive_field.h", |
477 "src/google/protobuf/compiler/js/js_generator.cc", | 484 "src/google/protobuf/compiler/js/js_generator.cc", |
478 "src/google/protobuf/compiler/js/js_generator.h", | 485 "src/google/protobuf/compiler/js/js_generator.h", |
479 "src/google/protobuf/compiler/main.cc", | |
480 "src/google/protobuf/compiler/objectivec/objectivec_enum.cc", | 486 "src/google/protobuf/compiler/objectivec/objectivec_enum.cc", |
481 "src/google/protobuf/compiler/objectivec/objectivec_enum.h", | 487 "src/google/protobuf/compiler/objectivec/objectivec_enum.h", |
482 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", | 488 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", |
483 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.h", | 489 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.h", |
484 "src/google/protobuf/compiler/objectivec/objectivec_extension.cc", | 490 "src/google/protobuf/compiler/objectivec/objectivec_extension.cc", |
485 "src/google/protobuf/compiler/objectivec/objectivec_extension.h", | 491 "src/google/protobuf/compiler/objectivec/objectivec_extension.h", |
486 "src/google/protobuf/compiler/objectivec/objectivec_field.cc", | 492 "src/google/protobuf/compiler/objectivec/objectivec_field.cc", |
487 "src/google/protobuf/compiler/objectivec/objectivec_field.h", | 493 "src/google/protobuf/compiler/objectivec/objectivec_field.h", |
488 "src/google/protobuf/compiler/objectivec/objectivec_file.cc", | 494 "src/google/protobuf/compiler/objectivec/objectivec_file.cc", |
489 "src/google/protobuf/compiler/objectivec/objectivec_file.h", | 495 "src/google/protobuf/compiler/objectivec/objectivec_file.h", |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 | 527 |
522 # Must be after no_chromium_code for warning flags to be ordered | 528 # Must be after no_chromium_code for warning flags to be ordered |
523 # correctly. | 529 # correctly. |
524 ":protobuf_warnings", | 530 ":protobuf_warnings", |
525 ] | 531 ] |
526 if (is_win) { | 532 if (is_win) { |
527 # This is defined internally, don't warn on duplicate. | 533 # This is defined internally, don't warn on duplicate. |
528 configs -= [ "//build/config/win:lean_and_mean" ] | 534 configs -= [ "//build/config/win:lean_and_mean" ] |
529 } | 535 } |
530 | 536 |
| 537 public_configs = [ ":protobuf_config" ] |
| 538 |
| 539 cflags = protobuf_lite_cflags |
| 540 |
| 541 public_deps = [ |
| 542 ":protobuf_full", |
| 543 ] |
| 544 } |
| 545 |
| 546 executable("protoc") { |
| 547 sources = [ |
| 548 "src/google/protobuf/compiler/main.cc", |
| 549 ] |
| 550 |
| 551 configs -= [ "//build/config/compiler:chromium_code" ] |
| 552 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 553 |
531 cflags = protobuf_lite_cflags | 554 cflags = protobuf_lite_cflags |
532 | 555 |
533 deps = [ | 556 deps = [ |
534 ":protobuf_full", | 557 ":protoc_lib", |
535 "//build/config/sanitizers:deps", | |
536 | 558 |
537 # Default manifest on Windows (a no-op elsewhere). | 559 # Default manifest on Windows (a no-op elsewhere). |
538 "//build/win:default_exe_manifest", | 560 "//build/win:default_exe_manifest", |
539 ] | 561 ] |
540 deps += [ "//build/config/sanitizers:deps" ] | |
541 } | 562 } |
542 } | 563 } |
543 | 564 |
544 google_python_dir = "$root_out_dir/pyproto/google" | 565 google_python_dir = "$root_out_dir/pyproto/google" |
545 | 566 |
546 copy("copy_google") { | 567 copy("copy_google") { |
547 sources = [ | 568 sources = [ |
548 "__init__.py", | 569 "__init__.py", |
549 ] | 570 ] |
550 outputs = [ | 571 outputs = [ |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 ":copy_google_protobuf_internal", | 638 ":copy_google_protobuf_internal", |
618 ":copy_six", | 639 ":copy_six", |
619 ] | 640 ] |
620 | 641 |
621 # Targets that depend on this should depend on the copied data files. | 642 # Targets that depend on this should depend on the copied data files. |
622 data = get_target_outputs(":copy_google") | 643 data = get_target_outputs(":copy_google") |
623 data += get_target_outputs(":copy_six") | 644 data += get_target_outputs(":copy_six") |
624 data += get_target_outputs(":copy_google_protobuf") | 645 data += get_target_outputs(":copy_google_protobuf") |
625 data += get_target_outputs(":copy_google_protobuf_internal") | 646 data += get_target_outputs(":copy_google_protobuf_internal") |
626 } | 647 } |
OLD | NEW |