xref: /aosp_15_r20/external/bazelbuild-rules_cc/cc/private/toolchain/BUILD (revision eed53cd41c5909d05eedc7ad9720bb158fd93452)
1load("//cc:defs.bzl", "cc_flags_supplier", "cc_library", "compiler_flag")
2
3# Copyright 2018 The Bazel Authors. All rights reserved.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#    http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17package(default_visibility = ["//visibility:public"])
18
19licenses(["notice"])  # Apache 2.0
20
21# It is frequently necessary to constrain platforms based on the cc compiler type.
22constraint_setting(name = "cc_compiler")
23
24constraint_value(
25    name = "clang",
26    constraint_setting = ":cc_compiler",
27)
28
29constraint_value(
30    name = "gcc",
31    constraint_setting = ":cc_compiler",
32)
33
34constraint_value(
35    name = "msvc",
36    constraint_setting = ":cc_compiler",
37)
38
39constraint_value(
40    name = "clang-cl",
41    constraint_setting = ":cc_compiler",
42)
43
44constraint_value(
45    name = "mingw",
46    constraint_setting = ":cc_compiler",
47)
48
49constraint_value(
50    name = "msys",
51    constraint_setting = ":cc_compiler",
52)
53
54cc_library(
55    name = "malloc",
56)
57
58filegroup(
59    name = "grep-includes",
60    srcs = ["grep-includes.sh"],
61)
62
63filegroup(
64    name = "empty",
65    srcs = [],
66)
67
68filegroup(
69    name = "bzl_srcs",
70    srcs = glob(["**/*.bzl"]),
71)
72
73filegroup(
74    name = "srcs",
75    srcs = glob(["**"]),
76)
77
78filegroup(
79    name = "interface_library_builder",
80    srcs = ["build_interface_so"],
81)
82
83filegroup(
84    name = "link_dynamic_library",
85    srcs = ["link_dynamic_library.sh"],
86)
87
88filegroup(
89    name = "lib_cc_configure",
90    srcs = ["lib_cc_configure.bzl"],
91)
92
93compiler_flag(name = "compiler")
94
95cc_flags_supplier(name = "cc_flags")
96