xref: /aosp_15_r20/external/cronet/build/config/siso/clang_all.star (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# -*- bazel-starlark -*-
2# Copyright 2023 The Chromium Authors
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5"""Siso configuration for clang."""
6
7load("@builtin//struct.star", "module")
8
9def __filegroups(ctx):
10    return {
11        "third_party/libc++/src/include:headers": {
12            "type": "glob",
13            "includes": ["*"],
14            # can't use "*.h", because c++ headers have no extension.
15        },
16        "third_party/libc++abi/src/include:headers": {
17            "type": "glob",
18            "includes": ["*.h"],
19        },
20        # vendor provided headers for libc++.
21        "buildtools/third_party/libc++:headers": {
22            "type": "glob",
23            "includes": ["__*"],
24        },
25
26        # toolchain root
27        # :headers for compiling
28        "third_party/llvm-build/Release+Asserts:headers": {
29            "type": "glob",
30            "includes": [
31                "*.h",
32                "bin/clang",
33                "bin/clang++",
34                "bin/clang-cl.exe",
35                "*_ignorelist.txt",
36            ],
37        },
38    }
39
40__input_deps = {
41    # need this because we use
42    # third_party/libc++/src/include:headers,
43    # but scandeps doesn't scan `__config` file, which uses
44    # `#include <__config_site>`
45    # also need `__assertion_handler`. b/321171148
46    "third_party/libc++/src/include": [
47        "buildtools/third_party/libc++:headers",
48    ],
49    "third_party/llvm-build/Release+Asserts/bin/clang": [
50        "build/config/unsafe_buffers_paths.txt",
51    ],
52    "third_party/llvm-build/Release+Asserts/bin/clang++": [
53        "build/config/unsafe_buffers_paths.txt",
54    ],
55    "third_party/llvm-build/Release+Asserts/bin/clang-cl": [
56        "build/config/unsafe_buffers_paths.txt",
57    ],
58    "third_party/llvm-build/Release+Asserts/bin/clang-cl.exe": [
59        "build/config/unsafe_buffers_paths.txt",
60    ],
61}
62
63clang_all = module(
64    "clang_all",
65    filegroups = __filegroups,
66    input_deps = __input_deps,
67)
68