Brian Silverman | 7d89e28 | 2021-11-17 17:36:54 -0800 | [diff] [blame^] | 1 | # Copyright 2021 The Bazel Authors. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://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, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | package(default_visibility = ["//visibility:public"]) |
| 16 | |
| 17 | # Some targets may need to directly depend on these files. |
| 18 | exports_files(glob([ |
| 19 | "bin/*", |
| 20 | "lib/*", |
| 21 | ])) |
| 22 | |
| 23 | ## LLVM toolchain files |
| 24 | |
| 25 | filegroup( |
| 26 | name = "clang", |
| 27 | srcs = [ |
| 28 | "bin/clang", |
| 29 | "bin/clang++", |
| 30 | "bin/clang-cpp", |
| 31 | ], |
| 32 | ) |
| 33 | |
| 34 | filegroup( |
| 35 | name = "ld", |
| 36 | srcs = [ |
| 37 | "bin/ld.lld", |
| 38 | ], |
| 39 | ) |
| 40 | |
| 41 | filegroup( |
| 42 | name = "include", |
| 43 | srcs = glob([ |
| 44 | "include/c++/**", |
| 45 | "lib/clang/*/include/**", |
| 46 | ]), |
| 47 | ) |
| 48 | |
| 49 | filegroup( |
| 50 | name = "bin", |
| 51 | srcs = glob(["bin/**"]), |
| 52 | ) |
| 53 | |
| 54 | filegroup( |
| 55 | name = "lib", |
| 56 | srcs = glob( |
| 57 | [ |
| 58 | "lib/lib*.a", |
| 59 | "lib/clang/*/lib/**/*.a", |
| 60 | ], |
| 61 | exclude = [ |
| 62 | "lib/libLLVM*.a", |
| 63 | "lib/libclang*.a", |
| 64 | "lib/liblld*.a", |
| 65 | ], |
| 66 | ) + glob( |
| 67 | [ |
| 68 | "lib/lib*.dylib", |
| 69 | "lib/clang/*/lib/**/*.dylib", |
| 70 | ], |
| 71 | allow_empty = True, |
| 72 | ), |
| 73 | ) |
| 74 | |
| 75 | filegroup( |
| 76 | name = "ar", |
| 77 | srcs = ["bin/llvm-ar"], |
| 78 | ) |
| 79 | |
| 80 | filegroup( |
| 81 | name = "as", |
| 82 | srcs = [ |
| 83 | "bin/clang", |
| 84 | "bin/llvm-as", |
| 85 | ], |
| 86 | ) |
| 87 | |
| 88 | filegroup( |
| 89 | name = "nm", |
| 90 | srcs = ["bin/llvm-nm"], |
| 91 | ) |
| 92 | |
| 93 | filegroup( |
| 94 | name = "objcopy", |
| 95 | srcs = ["bin/llvm-objcopy"], |
| 96 | ) |
| 97 | |
| 98 | filegroup( |
| 99 | name = "objdump", |
| 100 | srcs = ["bin/llvm-objdump"], |
| 101 | ) |
| 102 | |
| 103 | filegroup( |
| 104 | name = "profdata", |
| 105 | srcs = ["bin/llvm-profdata"], |
| 106 | ) |
| 107 | |
| 108 | filegroup( |
| 109 | name = "dwp", |
| 110 | srcs = ["bin/llvm-dwp"], |
| 111 | ) |
| 112 | |
| 113 | filegroup( |
| 114 | name = "ranlib", |
| 115 | srcs = ["bin/llvm-ranlib"], |
| 116 | ) |
| 117 | |
| 118 | filegroup( |
| 119 | name = "readelf", |
| 120 | srcs = ["bin/llvm-readelf"], |
| 121 | ) |
| 122 | |
| 123 | filegroup( |
| 124 | name = "strip", |
| 125 | srcs = ["bin/llvm-strip"], |
| 126 | ) |