aboutsummaryrefslogtreecommitdiffhomepage
path: root/bazel
diff options
context:
space:
mode:
Diffstat (limited to 'bazel')
-rw-r--r--bazel/grpc_build_system.bzl23
-rw-r--r--bazel/grpc_deps.bzl18
2 files changed, 18 insertions, 23 deletions
diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl
index 095b1596c8..a682d89ec9 100644
--- a/bazel/grpc_build_system.bzl
+++ b/bazel/grpc_build_system.bzl
@@ -36,9 +36,7 @@ def if_not_windows(a):
def _get_external_deps(external_deps):
ret = []
for dep in external_deps:
- if dep == "nanopb":
- ret += ["grpc_nanopb"]
- elif dep == "address_sorting":
+ if dep == "address_sorting":
ret += ["//third_party/address_sorting"]
elif dep == "cares":
ret += select({"//:grpc_no_ares": [],
@@ -160,24 +158,7 @@ def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], da
linkopts = if_not_windows(["-pthread"]) + linkopts,
)
-def grpc_generate_one_off_targets():
- native.cc_library(
- name = "grpc_nanopb",
- hdrs = [
- "//third_party/nanopb:pb.h",
- "//third_party/nanopb:pb_common.h",
- "//third_party/nanopb:pb_decode.h",
- "//third_party/nanopb:pb_encode.h",
- ],
- srcs = [
- "//third_party/nanopb:pb_common.c",
- "//third_party/nanopb:pb_decode.c",
- "//third_party/nanopb:pb_encode.c",
- ],
- defines = [
- "PB_FIELD_16BIT=1",
- ],
- )
+def grpc_generate_one_off_targets(): pass
def grpc_sh_test(name, srcs, args = [], data = []):
native.sh_test(
diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl
index 162ec1f5f5..f7e62f1219 100644
--- a/bazel/grpc_deps.bzl
+++ b/bazel/grpc_deps.bzl
@@ -2,6 +2,12 @@
def grpc_deps():
"""Loads dependencies need to compile and test the grpc library."""
+
+ native.bind(
+ name = "nanopb",
+ actual = "@com_github_nanopb_nanopb//:nanopb",
+ )
+
native.bind(
name = "libssl",
actual = "@boringssl//:ssl",
@@ -59,12 +65,12 @@ def grpc_deps():
native.bind(
name = "grpc_cpp_plugin",
- actual = "@com_github_grpc_grpc//:grpc_cpp_plugin"
+ actual = "@com_github_grpc_grpc//:grpc_cpp_plugin",
)
native.bind(
name = "grpc++_codegen_proto",
- actual = "@com_github_grpc_grpc//:grpc++_codegen_proto"
+ actual = "@com_github_grpc_grpc//:grpc++_codegen_proto",
)
if "boringssl" not in native.existing_rules():
@@ -87,6 +93,14 @@ def grpc_deps():
name = "com_google_protobuf",
strip_prefix = "protobuf-b5fbb742af122b565925987e65c08957739976a7",
url = "https://github.com/google/protobuf/archive/b5fbb742af122b565925987e65c08957739976a7.tar.gz",
+ )
+
+ if "com_github_nanopb_nanopb" not in native.existing_rules():
+ native.new_http_archive(
+ name = "com_github_nanopb_nanopb",
+ build_file = "@com_github_grpc_grpc//third_party:nanopb.BUILD",
+ strip_prefix = "nanopb-f8ac463766281625ad710900479130c7fcb4d63b",
+ url = "https://github.com/nanopb/nanopb/archive/f8ac463766281625ad710900479130c7fcb4d63b.tar.gz",
)
if "com_github_google_googletest" not in native.existing_rules():