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