diff options
Diffstat (limited to 'python/cc/BUILD.bazel')
-rw-r--r-- | python/cc/BUILD.bazel | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/python/cc/BUILD.bazel b/python/cc/BUILD.bazel new file mode 100644 index 0000000..0d90e15 --- /dev/null +++ b/python/cc/BUILD.bazel @@ -0,0 +1,44 @@ +# Package for C/C++ specific functionality of the Python rules. + +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED") +load("//python/private:current_py_cc_headers.bzl", "current_py_cc_headers") + +package( + default_visibility = ["//:__subpackages__"], +) + +# This target provides the C headers for whatever the current toolchain is +# for the consuming rule. It basically acts like a cc_library by forwarding +# on the providers for the underlying cc_library that the toolchain is using. +current_py_cc_headers( + name = "current_py_cc_headers", + # Building this directly will fail unless a py cc toolchain is registered, + # and it's only under bzlmod that one is registered by default. + tags = [] if BZLMOD_ENABLED else ["manual"], + visibility = ["//visibility:public"], +) + +toolchain_type( + name = "toolchain_type", + visibility = ["//visibility:public"], +) + +bzl_library( + name = "py_cc_toolchain_bzl", + srcs = ["py_cc_toolchain.bzl"], + visibility = ["//visibility:public"], + deps = ["//python/private:py_cc_toolchain_bzl"], +) + +bzl_library( + name = "py_cc_toolchain_info_bzl", + srcs = ["py_cc_toolchain_info.bzl"], + visibility = ["//visibility:public"], + deps = ["//python/private:py_cc_toolchain_info_bzl"], +) + +filegroup( + name = "distribution", + srcs = glob(["**"]), +) |