xref: /aosp_15_r20/external/bazelbuild-rules_cc/cc/toolchains/features/BUILD (revision eed53cd41c5909d05eedc7ad9720bb158fd93452)
1load("//cc/toolchains:feature_set.bzl", "cc_feature_set")
2load("//cc/toolchains/impl:external_feature.bzl", "cc_external_feature")
3
4package(default_visibility = ["//visibility:public"])
5
6# See https://bazel.build/docs/cc-toolchain-config-reference#wellknown-features
7
8cc_external_feature(
9    name = "opt",
10    feature_name = "opt",
11    overridable = True,
12)
13
14cc_external_feature(
15    name = "dbg",
16    feature_name = "dbg",
17    overridable = True,
18)
19
20cc_external_feature(
21    name = "fastbuild",
22    feature_name = "fastbuild",
23    overridable = True,
24)
25
26cc_external_feature(
27    name = "static_linking_mode",
28    feature_name = "static_linking_mode",
29    overridable = True,
30)
31
32cc_external_feature(
33    name = "dynamic_linking_mode",
34    feature_name = "dynamic_linking_mode",
35    overridable = True,
36)
37
38cc_external_feature(
39    name = "per_object_debug_info",
40    feature_name = "per_object_debug_info",
41    overridable = True,
42)
43
44cc_external_feature(
45    name = "supports_start_end_lib",
46    feature_name = "supports_start_end_lib",
47    overridable = True,
48)
49
50cc_external_feature(
51    name = "supports_interface_shared_libraries",
52    feature_name = "supports_interface_shared_libraries",
53    overridable = True,
54)
55
56cc_external_feature(
57    name = "supports_dynamic_linker",
58    feature_name = "supports_dynamic_linker",
59    overridable = True,
60)
61
62cc_external_feature(
63    name = "static_link_cpp_runtimes",
64    feature_name = "static_link_cpp_runtimes",
65    overridable = True,
66)
67
68cc_external_feature(
69    name = "supports_pic",
70    feature_name = "supports_pic",
71    overridable = True,
72)
73
74cc_feature_set(
75    name = "all_non_legacy_builtin_features",
76    all_of = [
77        ":opt",
78        ":dbg",
79        ":fastbuild",
80        ":static_linking_mode",
81        ":dynamic_linking_mode",
82        ":per_object_debug_info",
83        ":supports_start_end_lib",
84        ":supports_interface_shared_libraries",
85        ":supports_dynamic_linker",
86        ":static_link_cpp_runtimes",
87        ":supports_pic",
88    ],
89    visibility = ["//visibility:private"],
90)
91
92cc_feature_set(
93    name = "all_builtin_features",
94    all_of = [
95        ":all_non_legacy_builtin_features",
96        "//cc/toolchains/features/legacy:all_legacy_builtin_features",
97    ],
98)
99