diff --git a/MODULE.bazel b/MODULE.bazel index 6225a9a..75c2073 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -5,10 +5,10 @@ module( ) bazel_dep(name = "bazel_features", version = "1.36.0") -bazel_dep(name = "bazel_skylib", version = "1.8.1") +bazel_dep(name = "bazel_skylib", version = "1.8.2") bazel_dep(name = "platforms", version = "1.0.0") -bazel_dep(name = "rules_cc", version = "0.1.4") -bazel_dep(name = "rules_python", version = "1.5.1") +bazel_dep(name = "rules_cc", version = "0.2.9") +bazel_dep(name = "rules_python", version = "1.6.3") internal_configure = use_extension("//:internal_configure.bzl", "internal_configure_extension") use_repo(internal_configure, "pybind11") diff --git a/build_defs.bzl b/build_defs.bzl index bf740c6..6197400 100644 --- a/build_defs.bzl +++ b/build_defs.bzl @@ -6,6 +6,9 @@ """Build rules for pybind11.""" load("@bazel_skylib//rules:copy_file.bzl", "copy_file") +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") def register_extension_info(**kwargs): pass @@ -58,7 +61,7 @@ def pybind_extension( # Mark common dependencies as required for build_cleaner. tags = tags + ["req_dep=%s" % dep for dep in PYBIND_DEPS] - native.cc_binary( + cc_binary( name = name + ".so", copts = copts + PYBIND_COPTS + select({ Label("@pybind11//:msvc_compiler"): [], @@ -106,7 +109,7 @@ def pybind_library( # Mark common dependencies as required for build_cleaner. tags = tags + ["req_dep=%s" % dep for dep in PYBIND_DEPS] - native.cc_library( + cc_library( name = name, copts = copts + PYBIND_COPTS, features = features + PYBIND_FEATURES, @@ -127,7 +130,7 @@ def pybind_library_test( # Mark common dependencies as required for build_cleaner. tags = tags + ["req_dep=%s" % dep for dep in PYBIND_DEPS] - native.cc_test( + cc_test( name = name, copts = copts + PYBIND_COPTS, features = features + PYBIND_FEATURES, diff --git a/pybind11-BUILD.bazel b/pybind11-BUILD.bazel index a9b7c02..3a4c776 100644 --- a/pybind11-BUILD.bazel +++ b/pybind11-BUILD.bazel @@ -1,5 +1,5 @@ # pybind11 - Seamless operability between C++11 and Python. -load("@rules_cc//cc:defs.bzl", "cc_library") +load("@rules_cc//cc:cc_library.bzl", "cc_library") licenses(["notice"])