toolchains_llvm/toolchain/BUILD.llvm_repo

153 lines
2.8 KiB
Plaintext

# Copyright 2021 The Bazel Authors.
#
# 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.
package(default_visibility = ["//visibility:public"])
# Some targets may need to directly depend on these files.
exports_files(glob(
[
"bin/*",
"lib/*",
"include/*",
"share/clang/*",
],
allow_empty = True,
))
## LLVM toolchain files
filegroup(
name = "clang",
srcs = [
"bin/clang",
"bin/clang++",
"bin/clang-cpp",
],
)
filegroup(
name = "ld",
srcs = [
"bin/ld.lld",
"bin/ld64.lld",
"bin/wasm-ld",
],
)
filegroup(
name = "include",
srcs = glob([
"include/**/c++/**",
"lib/clang/*/include/**",
]),
)
filegroup(
name = "all_includes",
srcs = glob(
["include/**"],
allow_empty = True,
),
)
filegroup(
name = "bin",
srcs = glob(["bin/**"]),
)
filegroup(
name = "lib",
srcs = glob(
[
"lib/**/lib*.a",
"lib/clang/*/lib/**/*.a",
"lib/clang/*/lib/**/*.dylib",
# clang_rt.*.o supply crtbegin and crtend sections.
"lib/**/clang_rt.*.o",
],
allow_empty = True,
exclude = [
"lib/libLLVM*.a",
"lib/libclang*.a",
"lib/liblld*.a",
],
),
# Include the .dylib files in the linker sandbox even though they will
# not be available at runtime to allow sanitizers to work locally.
# Any library linked from the toolchain to be released should be linked statically.
)
filegroup(
name = "ar",
srcs = ["bin/llvm-ar"],
)
filegroup(
name = "as",
srcs = [
"bin/clang",
"bin/llvm-as",
],
)
filegroup(
name = "nm",
srcs = ["bin/llvm-nm"],
)
filegroup(
name = "objcopy",
srcs = ["bin/llvm-objcopy"],
)
filegroup(
name = "objdump",
srcs = ["bin/llvm-objdump"],
)
filegroup(
name = "profdata",
srcs = ["bin/llvm-profdata"],
)
filegroup(
name = "dwp",
srcs = ["bin/llvm-dwp"],
)
filegroup(
name = "ranlib",
srcs = ["bin/llvm-ranlib"],
)
filegroup(
name = "readelf",
srcs = ["bin/llvm-readelf"],
)
filegroup(
name = "strip",
srcs = ["bin/llvm-strip"],
)
filegroup(
name = "symbolizer",
srcs = ["bin/llvm-symbolizer"],
)
filegroup(
name = "clang-tidy",
srcs = ["bin/clang-tidy"],
)