Skip to content

Commit 0df1315

Browse files
Automated Code Change
PiperOrigin-RevId: 783044898
1 parent 8af5fad commit 0df1315

File tree

9 files changed

+20
-10
lines changed

9 files changed

+20
-10
lines changed

benchmarks/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# license that can be found in the LICENSE file or at
66
# https://developers.google.com/open-source/licenses/bsd
77

8+
load("@rules_cc//cc:cc_test.bzl", "cc_test")
89
load("@rules_python//python:defs.bzl", "py_binary")
910
load("//bazel:cc_proto_library.bzl", "cc_proto_library")
1011
load("//bazel:proto_library.bzl", "proto_library")

benchmarks/build_defs.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# license that can be found in the LICENSE file or at
66
# https://developers.google.com/open-source/licenses/bsd
77

8+
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
89
load("//bazel:cc_proto_library.bzl", "cc_proto_library")
910
load("//bazel:proto_library.bzl", "proto_library")
1011

@@ -22,7 +23,7 @@ def tmpl_cc_binary(name, gen, args, replacements = [], **kwargs):
2223
if _is_google3:
2324
kwargs["malloc"] = "@bazel_tools//tools/cpp:malloc"
2425
kwargs["features"] = ["-static_linking_mode"]
25-
native.cc_binary(
26+
cc_binary(
2627
name = name,
2728
srcs = srcs,
2829
**kwargs

python/py_extension.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Macro to support py_extension """
22

33
load("@bazel_skylib//lib:selects.bzl", "selects")
4+
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
45
load("@rules_python//python:py_library.bzl", "py_library")
56

67
def py_extension(name, srcs, copts, deps = [], **kwargs):
@@ -12,8 +13,7 @@ def py_extension(name, srcs, copts, deps = [], **kwargs):
1213
copts: List of C++ compile options to use
1314
deps: Libraries that the target depends on
1415
"""
15-
16-
native.cc_binary(
16+
cc_binary(
1717
name = name + "_binary",
1818
srcs = srcs,
1919
copts = copts + ["-fvisibility=hidden"],

upb/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# https://developers.google.com/open-source/licenses/bsd
77

88
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
9+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
910
load("@rules_python//python:defs.bzl", "py_binary")
1011
load("//bazel/private:upb_proto_library_internal/copts.bzl", "upb_proto_library_copts")
1112
load("//upb/bazel:amalgamation.bzl", "upb_amalgamation")

upb_generator/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# license that can be found in the LICENSE file or at
66
# https://developers.google.com/open-source/licenses/bsd
77

8+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
89
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS")
910
load(
1011
"//upb_generator:bootstrap_compiler.bzl",

upb_generator/bootstrap_compiler.bzl

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Macros that implement bootstrapping for the upb code generator."""
22

3+
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
4+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
35
load(
46
"//bazel:upb_minitable_proto_library.bzl",
57
"upb_minitable_proto_library",
@@ -57,7 +59,7 @@ def bootstrap_cc_library(name, visibility = [], deps = [], bootstrap_deps = [],
5759
upb_proto_library().
5860
"""
5961
for stage in _stages:
60-
native.cc_library(
62+
cc_library(
6163
name = name + stage,
6264
deps = deps + [dep + stage for dep in bootstrap_deps],
6365
visibility = _stage_visibility(stage, visibility),
@@ -81,7 +83,7 @@ def bootstrap_cc_binary(name, visibility = [], deps = [], bootstrap_deps = [], *
8183
upb_proto_library().
8284
"""
8385
for stage in _stages:
84-
native.cc_binary(
86+
cc_binary(
8587
name = name + stage,
8688
malloc = "@bazel_tools//tools/cpp:malloc",
8789
deps = deps + [dep + stage for dep in bootstrap_deps],
@@ -214,7 +216,7 @@ def bootstrap_upb_proto_library(
214216
_stage0_proto_staleness_test(name, src_files, src_rules, strip_prefix)
215217

216218
# stage0 uses checked-in protos, and has no MiniTable.
217-
native.cc_library(
219+
cc_library(
218220
name = name + "_stage0",
219221
srcs = _generated_hdrs_and_srcs(src_files, "stage0", "upb"),
220222
hdrs = [bootstrap_hdr],
@@ -230,8 +232,7 @@ def bootstrap_upb_proto_library(
230232
# Generate stage1 protos (C API and MiniTables) using stage0 compiler.
231233
_generate_stage1_proto(name, src_files, src_rules, "upb", kwargs)
232234
_generate_stage1_proto(name, src_files, src_rules, "upb_minitable", kwargs)
233-
234-
native.cc_library(
235+
cc_library(
235236
name = name + "_minitable_stage1",
236237
srcs = _generated_files(src_files, "stage1", "upb_minitable", "c"),
237238
hdrs = _generated_files(src_files, "stage1", "upb_minitable", "h"),
@@ -242,7 +243,7 @@ def bootstrap_upb_proto_library(
242243
] + [dep + "_minitable_stage1" for dep in deps],
243244
**kwargs
244245
)
245-
native.cc_library(
246+
cc_library(
246247
name = name + "_stage1",
247248
srcs = _generated_files(src_files, "stage1", "upb", "h"),
248249
hdrs = [bootstrap_hdr],
@@ -261,7 +262,7 @@ def bootstrap_upb_proto_library(
261262
deps = proto_lib_deps,
262263
**kwargs
263264
)
264-
native.cc_library(
265+
cc_library(
265266
name = name,
266267
hdrs = [bootstrap_hdr],
267268
deps = [name + "_upb_proto"],

upb_generator/common/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# license that can be found in the LICENSE file or at
66
# https://developers.google.com/open-source/licenses/bsd
77

8+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
9+
810
package(default_applicable_licenses = ["//:license"])
911

1012
# Note: this library should not depend on upb reflection or C++ proto

upb_generator/minitable/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# license that can be found in the LICENSE file or at
66
# https://developers.google.com/open-source/licenses/bsd
77

8+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
89
load("//bazel/toolchains:proto_lang_toolchain.bzl", "proto_lang_toolchain")
910
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS")
1011
load(

upb_generator/reflection/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# license that can be found in the LICENSE file or at
66
# https://developers.google.com/open-source/licenses/bsd
77

8+
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
9+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
810
load("//bazel/toolchains:proto_lang_toolchain.bzl", "proto_lang_toolchain")
911
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS")
1012

0 commit comments

Comments
 (0)