• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2009-2021, Google LLC
2# All rights reserved.
3#
4# Use of this source code is governed by a BSD-style
5# license that can be found in the LICENSE file or at
6# https://developers.google.com/open-source/licenses/bsd
7
8load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS")
9load(
10    "//upb_generator:bootstrap_compiler.bzl",
11    "bootstrap_cc_library",
12    "bootstrap_upb_proto_library",
13)
14
15package(default_applicable_licenses = ["//:license"])
16
17licenses(["notice"])
18
19bootstrap_upb_proto_library(
20    name = "plugin_upb_proto",
21    bootstrap_hdr = "plugin_bootstrap.h",
22    google3_src_files = [
23        "net/proto2/compiler/proto/profile.proto",
24        "third_party/protobuf/compiler/plugin.proto",
25    ],
26    google3_src_rules = [
27        "//net/proto2/proto:descriptor_proto_source",
28        "//net/proto2/compiler/proto:profile.proto",
29        "//src/google/protobuf/compiler:plugin_proto_source",
30    ],
31    oss_src_files = ["google/protobuf/compiler/plugin.proto"],
32    oss_src_rules = [
33        "//:descriptor_proto_srcs",
34        "//src/google/protobuf/compiler:plugin_proto_src",
35    ],
36    oss_strip_prefix = "third_party/protobuf/github/bootstrap/src",
37    proto_lib_deps = ["//:compiler_plugin_proto"],
38    deps = ["//upb/reflection:descriptor_upb_proto"],
39)
40
41bootstrap_cc_library(
42    name = "common",
43    srcs = [
44        "common.cc",
45    ],
46    hdrs = [
47        "common.h",
48    ],
49    bootstrap_deps = [
50        "//upb/reflection:reflection",
51    ],
52    copts = UPB_DEFAULT_CPPOPTS,
53    visibility = ["//upb:friend_generators"],
54    deps = [
55        "//src/google/protobuf:port",
56        "//upb:mini_table",
57        "//upb:port",
58        "@com_google_absl//absl/strings",
59    ],
60)
61
62bootstrap_cc_library(
63    name = "file_layout",
64    srcs = [
65        "file_layout.cc",
66    ],
67    hdrs = [
68        "file_layout.h",
69    ],
70    bootstrap_deps = [
71        ":common",
72        "//upb/reflection:reflection",
73        "//upb/reflection:descriptor_upb_proto",
74    ],
75    copts = UPB_DEFAULT_CPPOPTS,
76    visibility = ["//visibility:public"],
77    deps = [
78        "//upb:base",
79        "//upb:mini_descriptor",
80        "//upb:mini_table",
81        "//upb:port",
82        "@com_google_absl//absl/container:flat_hash_map",
83        "@com_google_absl//absl/strings",
84    ],
85)
86
87bootstrap_cc_library(
88    name = "plugin",
89    hdrs = [
90        "plugin.h",
91    ],
92    bootstrap_deps = [
93        ":plugin_upb_proto",
94        "//upb/reflection:descriptor_upb_proto",
95        "//upb/reflection:reflection",
96    ],
97    copts = UPB_DEFAULT_CPPOPTS,
98    visibility = ["//upb:friend_generators"],
99    deps = [
100        "//src/google/protobuf/compiler:code_generator_lite",
101        "//upb:base",
102        "//upb:mem",
103        "//upb:port",
104        "@com_google_absl//absl/container:flat_hash_map",
105        "@com_google_absl//absl/container:flat_hash_set",
106        "@com_google_absl//absl/log:absl_check",
107        "@com_google_absl//absl/log:absl_log",
108        "@com_google_absl//absl/strings",
109    ],
110)
111
112cc_library(name = "mangle")
113