Skip to content

Commit 218bc65

Browse files
benjaminpjohnbartholomew
authored andcommitted
add loads for cc rules to BUILD files
builtin rules are removed in newer versions of Bazel
1 parent 27b0d5b commit 218bc65

13 files changed

Lines changed: 29 additions & 1 deletion

File tree

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ module(
55

66
bazel_dep(name = "googletest", version = "1.16.0")
77
bazel_dep(name = "rules_python", version = "1.2.0")
8+
bazel_dep(name = "rules_cc", version = "0.2.14")

cmd/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
2+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
3+
14
package(default_visibility = ["//visibility:private"])
25

36
cc_library(

core/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
2+
load("@rules_cc//cc:cc_test.bzl", "cc_test")
3+
14
package(default_visibility = ["//visibility:private"])
25

36
cc_library(

cpp/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
2+
load("@rules_cc//cc:cc_test.bzl", "cc_test")
3+
14
package(default_visibility = ["//visibility:private"])
25

36
cc_library(

examples/bazel/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
12
load("@rules_python//python:defs.bzl", "py_binary")
23

34
cc_binary(

examples/bazel/MODULE.bazel

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Example of using jsonnet by depending on the Bazel module.
22

33
bazel_dep(name = "rules_python", version = "1.2.0")
4+
bazel_dep(name = "rules_cc", version = "0.2.14")
45
bazel_dep(name = "jsonnet")
5-
local_path_override(module_name = "jsonnet", path = "../..")
6+
local_path_override(
7+
module_name = "jsonnet",
8+
path = "../..",
9+
)

include/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
2+
13
package(default_visibility = ["//visibility:private"])
24

35
cc_library(

python/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
12
load("@rules_python//python:defs.bzl", "py_library", "py_test")
23

34
package(default_visibility = ["//visibility:private"])

stdlib/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
2+
13
package(default_visibility = ["//visibility:private"])
24

35
filegroup(

test_suite/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_shell//shell:sh_library.bzl", "sh_library")
2+
13
package(default_visibility = ["//visibility:private"])
24

35
# Export the tests.source so it can be used by Bazel tests elsewhere in the repo.

0 commit comments

Comments
 (0)