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

Side by Side Diff: third_party/protobuf/BUILD

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Created 4 years, 1 month 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
OLDNEW
1 # Bazel (http://bazel.io/) BUILD file for Protobuf. 1 # Bazel (http://bazel.io/) BUILD file for Protobuf.
2 2
3 licenses(["notice"]) 3 licenses(["notice"])
4 4
5 exports_files(["LICENSE"])
6
5 ################################################################################ 7 ################################################################################
6 # Protobuf Runtime Library 8 # Protobuf Runtime Library
7 ################################################################################ 9 ################################################################################
8 10
9 COPTS = [ 11 COPTS = [
10 "-DHAVE_PTHREAD", 12 "-DHAVE_PTHREAD",
11 "-Wall", 13 "-Wall",
12 "-Wwrite-strings", 14 "-Wwrite-strings",
13 "-Woverloaded-virtual", 15 "-Woverloaded-virtual",
14 "-Wno-sign-compare", 16 "-Wno-sign-compare",
15 "-Wno-error=unused-function", 17 "-Wno-unused-function",
16 ] 18 ]
17 19
18 config_setting( 20 config_setting(
19 name = "android", 21 name = "android",
20 values = { 22 values = {
21 "crosstool_top": "//external:android/crosstool", 23 "crosstool_top": "//external:android/crosstool",
22 }, 24 },
23 ) 25 )
24 26
25 # Android builds do not need to link in a separate pthread library. 27 # Android builds do not need to link in a separate pthread library.
26 LINK_OPTS = select({ 28 LINK_OPTS = select({
27 ":android": [], 29 ":android": [],
28 "//conditions:default": ["-lpthread"], 30 "//conditions:default": ["-lpthread"],
29 }) 31 })
30 32
31 load( 33 load(
32 "protobuf", 34 "protobuf",
33 "cc_proto_library", 35 "cc_proto_library",
34 "py_proto_library", 36 "py_proto_library",
37 "internal_copied_filegroup",
35 "internal_gen_well_known_protos_java", 38 "internal_gen_well_known_protos_java",
36 "internal_protobuf_py_tests", 39 "internal_protobuf_py_tests",
37 ) 40 )
38 41
39 config_setting( 42 config_setting(
40 name = "ios_armv7", 43 name = "ios_armv7",
41 values = { 44 values = {
42 "ios_cpu": "armv7", 45 "ios_cpu": "armv7",
43 }, 46 },
44 ) 47 )
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 "src/google/protobuf/compiler/objectivec/objectivec_extension.cc", 309 "src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
307 "src/google/protobuf/compiler/objectivec/objectivec_field.cc", 310 "src/google/protobuf/compiler/objectivec/objectivec_field.cc",
308 "src/google/protobuf/compiler/objectivec/objectivec_file.cc", 311 "src/google/protobuf/compiler/objectivec/objectivec_file.cc",
309 "src/google/protobuf/compiler/objectivec/objectivec_generator.cc", 312 "src/google/protobuf/compiler/objectivec/objectivec_generator.cc",
310 "src/google/protobuf/compiler/objectivec/objectivec_helpers.cc", 313 "src/google/protobuf/compiler/objectivec/objectivec_helpers.cc",
311 "src/google/protobuf/compiler/objectivec/objectivec_map_field.cc", 314 "src/google/protobuf/compiler/objectivec/objectivec_map_field.cc",
312 "src/google/protobuf/compiler/objectivec/objectivec_message.cc", 315 "src/google/protobuf/compiler/objectivec/objectivec_message.cc",
313 "src/google/protobuf/compiler/objectivec/objectivec_message_field.cc", 316 "src/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
314 "src/google/protobuf/compiler/objectivec/objectivec_oneof.cc", 317 "src/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
315 "src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc", 318 "src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
319 "src/google/protobuf/compiler/php/php_generator.cc",
316 "src/google/protobuf/compiler/plugin.cc", 320 "src/google/protobuf/compiler/plugin.cc",
317 "src/google/protobuf/compiler/plugin.pb.cc", 321 "src/google/protobuf/compiler/plugin.pb.cc",
318 "src/google/protobuf/compiler/python/python_generator.cc", 322 "src/google/protobuf/compiler/python/python_generator.cc",
319 "src/google/protobuf/compiler/ruby/ruby_generator.cc", 323 "src/google/protobuf/compiler/ruby/ruby_generator.cc",
320 "src/google/protobuf/compiler/subprocess.cc", 324 "src/google/protobuf/compiler/subprocess.cc",
321 "src/google/protobuf/compiler/zip_writer.cc", 325 "src/google/protobuf/compiler/zip_writer.cc",
322 ], 326 ],
323 copts = COPTS, 327 copts = COPTS,
324 includes = ["src/"], 328 includes = ["src/"],
325 linkopts = LINK_OPTS, 329 linkopts = LINK_OPTS,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 "google/protobuf/unittest_proto3_arena_lite.proto", 384 "google/protobuf/unittest_proto3_arena_lite.proto",
381 "google/protobuf/unittest_proto3_lite.proto", 385 "google/protobuf/unittest_proto3_lite.proto",
382 "google/protobuf/unittest_well_known_types.proto", 386 "google/protobuf/unittest_well_known_types.proto",
383 "google/protobuf/util/internal/testdata/anys.proto", 387 "google/protobuf/util/internal/testdata/anys.proto",
384 "google/protobuf/util/internal/testdata/books.proto", 388 "google/protobuf/util/internal/testdata/books.proto",
385 "google/protobuf/util/internal/testdata/default_value.proto", 389 "google/protobuf/util/internal/testdata/default_value.proto",
386 "google/protobuf/util/internal/testdata/default_value_test.proto", 390 "google/protobuf/util/internal/testdata/default_value_test.proto",
387 "google/protobuf/util/internal/testdata/field_mask.proto", 391 "google/protobuf/util/internal/testdata/field_mask.proto",
388 "google/protobuf/util/internal/testdata/maps.proto", 392 "google/protobuf/util/internal/testdata/maps.proto",
389 "google/protobuf/util/internal/testdata/oneofs.proto", 393 "google/protobuf/util/internal/testdata/oneofs.proto",
394 "google/protobuf/util/internal/testdata/proto3.proto",
390 "google/protobuf/util/internal/testdata/struct.proto", 395 "google/protobuf/util/internal/testdata/struct.proto",
391 "google/protobuf/util/internal/testdata/timestamp_duration.proto", 396 "google/protobuf/util/internal/testdata/timestamp_duration.proto",
397 "google/protobuf/util/internal/testdata/wrappers.proto",
392 "google/protobuf/util/json_format_proto3.proto", 398 "google/protobuf/util/json_format_proto3.proto",
393 "google/protobuf/util/message_differencer_unittest.proto", 399 "google/protobuf/util/message_differencer_unittest.proto",
394 ] 400 ]
395 401
396 TEST_PROTOS = ["src/" + s for s in RELATIVE_TEST_PROTOS] 402 TEST_PROTOS = ["src/" + s for s in RELATIVE_TEST_PROTOS]
397 403
398 cc_proto_library( 404 cc_proto_library(
399 name = "cc_test_protos", 405 name = "cc_test_protos",
400 srcs = LITE_TEST_PROTOS + TEST_PROTOS, 406 srcs = LITE_TEST_PROTOS + TEST_PROTOS,
401 include = "src", 407 include = "src",
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 ################################################################################ 559 ################################################################################
554 560
555 py_library( 561 py_library(
556 name = "python_srcs", 562 name = "python_srcs",
557 srcs = glob( 563 srcs = glob(
558 [ 564 [
559 "python/google/protobuf/*.py", 565 "python/google/protobuf/*.py",
560 "python/google/protobuf/**/*.py", 566 "python/google/protobuf/**/*.py",
561 ], 567 ],
562 exclude = [ 568 exclude = [
569 "python/google/protobuf/__init__.py",
570 "python/google/protobuf/**/__init__.py",
563 "python/google/protobuf/internal/*_test.py", 571 "python/google/protobuf/internal/*_test.py",
564 "python/google/protobuf/internal/test_util.py", 572 "python/google/protobuf/internal/test_util.py",
565 ], 573 ],
566 ), 574 ),
567 srcs_version = "PY2AND3", 575 srcs_version = "PY2AND3",
568 imports = ["python"], 576 imports = ["python"],
569 ) 577 )
570 578
571 cc_binary( 579 cc_binary(
572 name = "internal/_api_implementation.so", 580 name = "python/google/protobuf/internal/_api_implementation.so",
573 srcs = ["python/google/protobuf/internal/api_implementation.cc"], 581 srcs = ["python/google/protobuf/internal/api_implementation.cc"],
574 copts = COPTS + [ 582 copts = COPTS + [
575 "-DPYTHON_PROTO2_CPP_IMPL_V2", 583 "-DPYTHON_PROTO2_CPP_IMPL_V2",
576 ], 584 ],
577 linkshared = 1, 585 linkshared = 1,
578 linkstatic = 1, 586 linkstatic = 1,
579 deps = select({ 587 deps = select({
580 "//conditions:default": [], 588 "//conditions:default": [],
581 ":use_fast_cpp_protos": ["//external:python_headers"], 589 ":use_fast_cpp_protos": ["//external:python_headers"],
582 }), 590 }),
583 ) 591 )
584 592
585 cc_binary( 593 cc_binary(
586 name = "pyext/_message.so", 594 name = "python/google/protobuf/pyext/_message.so",
587 srcs = glob([ 595 srcs = glob([
588 "python/google/protobuf/pyext/*.cc", 596 "python/google/protobuf/pyext/*.cc",
589 "python/google/protobuf/pyext/*.h", 597 "python/google/protobuf/pyext/*.h",
590 ]), 598 ]),
591 copts = COPTS + [ 599 copts = COPTS + [
592 "-DGOOGLE_PROTOBUF_HAS_ONEOF=1", 600 "-DGOOGLE_PROTOBUF_HAS_ONEOF=1",
593 ] + select({ 601 ] + select({
594 "//conditions:default": [], 602 "//conditions:default": [],
595 ":allow_oversize_protos": ["-DPROTOBUF_PYTHON_ALLOW_OVERSIZE_PROTOS=1"], 603 ":allow_oversize_protos": ["-DPROTOBUF_PYTHON_ALLOW_OVERSIZE_PROTOS=1"],
596 }), 604 }),
(...skipping 18 matching lines...) Expand all
615 }, 623 },
616 ) 624 )
617 625
618 config_setting( 626 config_setting(
619 name = "allow_oversize_protos", 627 name = "allow_oversize_protos",
620 values = { 628 values = {
621 "define": "allow_oversize_protos=true", 629 "define": "allow_oversize_protos=true",
622 }, 630 },
623 ) 631 )
624 632
633 # Copy the builtin proto files from src/google/protobuf to
634 # python/google/protobuf. This way, the generated Python sources will be in the
635 # same directory as the Python runtime sources. This is necessary for the
636 # modules to be imported correctly since they are all part of the same Python
637 # package.
638 internal_copied_filegroup(
639 name = "protos_python",
640 srcs = WELL_KNOWN_PROTOS,
641 strip_prefix = "src",
642 dest = "python",
643 )
644
645 # TODO(dzc): Remove this once py_proto_library can have labels in srcs, in
646 # which case we can simply add :protos_python in srcs.
647 COPIED_WELL_KNOWN_PROTOS = ["python/" + s for s in RELATIVE_WELL_KNOWN_PROTOS]
648
625 py_proto_library( 649 py_proto_library(
626 name = "protobuf_python", 650 name = "protobuf_python",
627 srcs = WELL_KNOWN_PROTOS, 651 srcs = COPIED_WELL_KNOWN_PROTOS,
628 include = "src", 652 include = "python",
629 data = select({ 653 data = select({
630 "//conditions:default": [], 654 "//conditions:default": [],
631 ":use_fast_cpp_protos": [ 655 ":use_fast_cpp_protos": [
632 ":internal/_api_implementation.so", 656 ":python/google/protobuf/internal/_api_implementation.so",
633 ":pyext/_message.so", 657 ":python/google/protobuf/pyext/_message.so",
634 ], 658 ],
635 }), 659 }),
636 default_runtime = "", 660 default_runtime = "",
637 protoc = ":protoc", 661 protoc = ":protoc",
638 py_libs = [ 662 py_libs = [
639 ":python_srcs", 663 ":python_srcs",
640 "//external:six" 664 "//external:six"
641 ], 665 ],
642 srcs_version = "PY2AND3", 666 srcs_version = "PY2AND3",
643 visibility = ["//visibility:public"], 667 visibility = ["//visibility:public"],
644 ) 668 )
645 669
670 # Copy the test proto files from src/google/protobuf to
671 # python/google/protobuf. This way, the generated Python sources will be in the
672 # same directory as the Python runtime sources. This is necessary for the
673 # modules to be imported correctly by the tests since they are all part of the
674 # same Python package.
675 internal_copied_filegroup(
676 name = "protos_python_test",
677 srcs = LITE_TEST_PROTOS + TEST_PROTOS,
678 strip_prefix = "src",
679 dest = "python",
680 )
681
682 # TODO(dzc): Remove this once py_proto_library can have labels in srcs, in
683 # which case we can simply add :protos_python_test in srcs.
684 COPIED_LITE_TEST_PROTOS = ["python/" + s for s in RELATIVE_LITE_TEST_PROTOS]
685 COPIED_TEST_PROTOS = ["python/" + s for s in RELATIVE_TEST_PROTOS]
686
646 py_proto_library( 687 py_proto_library(
647 name = "python_common_test_protos", 688 name = "python_common_test_protos",
648 srcs = LITE_TEST_PROTOS + TEST_PROTOS, 689 srcs = COPIED_LITE_TEST_PROTOS + COPIED_TEST_PROTOS,
649 include = "src", 690 include = "python",
650 default_runtime = "", 691 default_runtime = "",
651 protoc = ":protoc", 692 protoc = ":protoc",
652 srcs_version = "PY2AND3", 693 srcs_version = "PY2AND3",
653 deps = [":protobuf_python"], 694 deps = [":protobuf_python"],
654 ) 695 )
655 696
656 py_proto_library( 697 py_proto_library(
657 name = "python_specific_test_protos", 698 name = "python_specific_test_protos",
658 srcs = glob([ 699 srcs = glob([
659 "python/google/protobuf/internal/*.proto", 700 "python/google/protobuf/internal/*.proto",
660 "python/google/protobuf/internal/import_test_package/*.proto", 701 "python/google/protobuf/internal/import_test_package/*.proto",
661 ]), 702 ]),
662 include = "python", 703 include = "python",
663 default_runtime = ":protobuf_python", 704 default_runtime = ":protobuf_python",
664 protoc = ":protoc", 705 protoc = ":protoc",
665 srcs_version = "PY2AND3", 706 srcs_version = "PY2AND3",
666 deps = [":python_common_test_protos"], 707 deps = [":python_common_test_protos"],
667 ) 708 )
668 709
669 py_library( 710 py_library(
670 name = "python_tests", 711 name = "python_tests",
671 srcs = glob( 712 srcs = glob(
672 [ 713 [
673 "python/google/protobuf/internal/*_test.py", 714 "python/google/protobuf/internal/*_test.py",
674 "python/google/protobuf/internal/test_util.py", 715 "python/google/protobuf/internal/test_util.py",
716 "python/google/protobuf/internal/import_test_package/__init__.py",
675 ], 717 ],
676 ), 718 ),
677 imports = ["python"], 719 imports = ["python"],
678 srcs_version = "PY2AND3", 720 srcs_version = "PY2AND3",
679 deps = [ 721 deps = [
680 ":protobuf_python", 722 ":protobuf_python",
681 ":python_common_test_protos", 723 ":python_common_test_protos",
682 ":python_specific_test_protos", 724 ":python_specific_test_protos",
683 ], 725 ],
684 ) 726 )
(...skipping 15 matching lines...) Expand all
700 "reflection_test", 742 "reflection_test",
701 "service_reflection_test", 743 "service_reflection_test",
702 "symbol_database_test", 744 "symbol_database_test",
703 "text_encoding_test", 745 "text_encoding_test",
704 "text_format_test", 746 "text_format_test",
705 "unknown_fields_test", 747 "unknown_fields_test",
706 "wire_format_test", 748 "wire_format_test",
707 ], 749 ],
708 deps = [":python_tests"], 750 deps = [":python_tests"],
709 ) 751 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698