forked from bazel-contrib/rules_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUILD.bazel
More file actions
67 lines (58 loc) · 2.5 KB
/
BUILD.bazel
File metadata and controls
67 lines (58 loc) · 2.5 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# 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", "current_py_cc_headers_abi3")
load("//python/private:current_py_cc_libs.bzl", "current_py_cc_libs")
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"],
)
# This target provides the C ABI3 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_abi3(
name = "current_py_cc_headers_abi3",
# 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"],
)
# This target provides the C libraries 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_libs(
name = "current_py_cc_libs",
# 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_macro_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(["**"]),
)