[Bazel] Rework LLVM target selection
authorGeoffrey Martin-Noble <gcmn@google.com>
Mon, 28 Jun 2021 20:09:48 +0000 (13:09 -0700)
committerGeoffrey Martin-Noble <gcmn@google.com>
Wed, 30 Jun 2021 23:53:00 +0000 (16:53 -0700)
commit4aa1c141bd674564aaee83516b7e338aa3aae9e3
tree49b5e679fb2e13e844373e57e8cc178e857ee32a
parent9cc1ddd393c9d8856e3fc7dce675a4d95de55adc
[Bazel] Rework LLVM target selection

This patch introduces a custom rule for expanding the LLVM target
enumeration .def files. This provides a slightly cleaner API for these
rules, but is mostly to permit selects to be used when determining which
LLVM targets to build. Right now the target list is generated at Bazel
configure time, but this will allows us to add functionality to also
control which targets are built based on config settings.

Tested: Ran `bazel test --config=rbe ... @llvm-project//...`

Reviewed By: chandlerc

Differential Revision: https://reviews.llvm.org/D104969
utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
utils/bazel/llvm-project-overlay/llvm/enum_targets_gen.bzl [new file with mode: 0644]