xref: /aosp_15_r20/external/pigweed/pw_toolchain/host_clang/linux_sysroot.BUILD (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2024 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15load("@bazel_skylib//rules/directory:directory.bzl", "directory")
16load("@bazel_skylib//rules/directory:subdirectory.bzl", "subdirectory")
17load("@rules_cc//cc/toolchains/args:sysroot.bzl", "cc_sysroot")
18
19package(default_visibility = ["//visibility:public"])
20
21cc_sysroot(
22    name = "sysroot",
23    sysroot = ":root",
24    data = [":root"],
25    allowlist_include_directories = [
26        ":usr-include-arm-linux-gnueabihf",
27        ":usr-include-x86_64-linux-gnu",
28        ":usr-include",
29    ],
30)
31
32directory(
33    name = "root",
34    srcs = glob(["**/*"]),
35)
36
37subdirectory(
38    name = "usr-include-arm-linux-gnueabihf",
39    parent = ":root",
40    path = "usr/include/arm-linux-gnueabihf",
41)
42
43subdirectory(
44    name = "usr-include-x86_64-linux-gnu",
45    parent = ":root",
46    path = "usr/include/x86_64-linux-gnu",
47)
48
49subdirectory(
50    name = "usr-include",
51    parent = ":root",
52    path = "usr/include",
53)
54