aboutsummaryrefslogtreecommitdiff
path: root/python/cc/BUILD.bazel
blob: 0d90e15225edcfa68fec567774cdac2da3b74733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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(["**"]),
)