Skip to content

Commit 447e6ed

Browse files
committed
rework rules_cc usage
* bump to version 0.2.9
1 parent 79ee09c commit 447e6ed

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module(
77
bazel_dep(name = "bazel_features", version = "1.36.0")
88
bazel_dep(name = "bazel_skylib", version = "1.8.1")
99
bazel_dep(name = "platforms", version = "1.0.0")
10-
bazel_dep(name = "rules_cc", version = "0.1.4")
10+
bazel_dep(name = "rules_cc", version = "0.2.9")
1111
bazel_dep(name = "rules_python", version = "1.5.1")
1212

1313
internal_configure = use_extension("//:internal_configure.bzl", "internal_configure_extension")

build_defs.bzl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"""Build rules for pybind11."""
77

88
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
9+
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
10+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
11+
load("@rules_cc//cc:cc_test.bzl", "cc_test")
912

1013
def register_extension_info(**kwargs):
1114
pass
@@ -58,7 +61,7 @@ def pybind_extension(
5861
# Mark common dependencies as required for build_cleaner.
5962
tags = tags + ["req_dep=%s" % dep for dep in PYBIND_DEPS]
6063

61-
native.cc_binary(
64+
cc_binary(
6265
name = name + ".so",
6366
copts = copts + PYBIND_COPTS + select({
6467
Label("@pybind11//:msvc_compiler"): [],
@@ -106,7 +109,7 @@ def pybind_library(
106109
# Mark common dependencies as required for build_cleaner.
107110
tags = tags + ["req_dep=%s" % dep for dep in PYBIND_DEPS]
108111

109-
native.cc_library(
112+
cc_library(
110113
name = name,
111114
copts = copts + PYBIND_COPTS,
112115
features = features + PYBIND_FEATURES,
@@ -127,7 +130,7 @@ def pybind_library_test(
127130
# Mark common dependencies as required for build_cleaner.
128131
tags = tags + ["req_dep=%s" % dep for dep in PYBIND_DEPS]
129132

130-
native.cc_test(
133+
cc_test(
131134
name = name,
132135
copts = copts + PYBIND_COPTS,
133136
features = features + PYBIND_FEATURES,

pybind11-BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pybind11 - Seamless operability between C++11 and Python.
2-
load("@rules_cc//cc:defs.bzl", "cc_library")
2+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
33

44
licenses(["notice"])
55

0 commit comments

Comments
 (0)