1# Package for C/C++ specific functionality of the Python rules. 2 3load("@bazel_skylib//:bzl_library.bzl", "bzl_library") 4load("//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED") 5load("//python/private:current_py_cc_headers.bzl", "current_py_cc_headers") 6 7package( 8 default_visibility = ["//:__subpackages__"], 9) 10 11# This target provides the C headers for whatever the current toolchain is 12# for the consuming rule. It basically acts like a cc_library by forwarding 13# on the providers for the underlying cc_library that the toolchain is using. 14current_py_cc_headers( 15 name = "current_py_cc_headers", 16 # Building this directly will fail unless a py cc toolchain is registered, 17 # and it's only under bzlmod that one is registered by default. 18 tags = [] if BZLMOD_ENABLED else ["manual"], 19 visibility = ["//visibility:public"], 20) 21 22toolchain_type( 23 name = "toolchain_type", 24 visibility = ["//visibility:public"], 25) 26 27bzl_library( 28 name = "py_cc_toolchain_bzl", 29 srcs = ["py_cc_toolchain.bzl"], 30 visibility = ["//visibility:public"], 31 deps = ["//python/private:py_cc_toolchain_bzl"], 32) 33 34bzl_library( 35 name = "py_cc_toolchain_info_bzl", 36 srcs = ["py_cc_toolchain_info.bzl"], 37 visibility = ["//visibility:public"], 38 deps = ["//python/private:py_cc_toolchain_info_bzl"], 39) 40 41filegroup( 42 name = "distribution", 43 srcs = glob(["**"]), 44) 45