-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathBUILD.bazel
More file actions
66 lines (60 loc) · 2.1 KB
/
Copy pathBUILD.bazel
File metadata and controls
66 lines (60 loc) · 2.1 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
# Copyright (c) Joby Aviation 2022
# Original authors: Thulio Ferraz Assis (thulio@aspect.dev), Aspect.dev
#
# Copyright (c) Thulio Ferraz Assis 2024
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load(":defs.bzl", "AVAILABLE_GCC_VERSIONS")
# Selects which GCC version the registered toolchains resolve to. The empty default defers to the
# gcc_version each toolchain was declared with.
string_flag(
name = "gcc_version",
build_setting_default = "",
visibility = ["//visibility:public"],
)
# Matches when gcc_version is set to that exact version. None of these match while the flag is left
# at its empty default, so a select over them needs a //conditions:default branch.
[
config_setting(
name = "gcc_version_{}".format(gcc_version.replace(".", "_")),
flag_values = {":gcc_version": gcc_version},
visibility = ["//visibility:public"],
)
for gcc_version in AVAILABLE_GCC_VERSIONS
]
exports_files(
["config.bzl"],
visibility = ["//visibility:public"],
)
exports_files(
glob(["*.bzl"]),
visibility = ["//docs:__pkg__"],
)
bzl_library(
name = "defs",
srcs = [
"defs.bzl",
"module_extensions.bzl",
],
visibility = ["//visibility:public"],
deps = [
"@bazel_lib//lib:utils",
"@bazel_skylib//lib:dicts",
"@bazel_skylib//lib:paths",
"@bazel_tools//tools/build_defs/repo:cache.bzl",
"@bazel_tools//tools/build_defs/repo:http.bzl",
"@bazel_tools//tools/build_defs/repo:utils.bzl",
],
)