[all-commits] [llvm/llvm-project] 892260: [bazel] Respect llvm_target_list in llvm-exegesis

Jordan Rupprecht via All-commits all-commits at lists.llvm.org
Thu Sep 22 19:20:23 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 892260d7f3526c429047b645f22401635a7df368
  Author: Jordan Rupprecht <rupprecht at google.com>
  Date:   2022-09-22 (Thu, 22 Sep 2022)

  Changed paths:
    M utils/bazel/llvm-project-overlay/llvm/BUILD.bazel

  Log Message:
  [bazel] Respect llvm_target_list in llvm-exegesis

- 47afaf2eb02b1424a9aba241ccd02393a0cbc648 changed llvm-exegesis cmake rules
- 5b2f838db42ea190fdda147a33b5f0fcc8145689 ported them to bazel, but did so by adding all the `lib/{target}/*.cpp` sources in exegesis to the build rule
- c7bf9d084d037aa6c8fd479be9ccdf963dc59e10 removed it, because it breaks users who don't build Mips and fail when building `lib/Mips/*.cpp`. But that in turn breaks those who *do* build the Mips target.

This should hopefully fix it for the final time by using selectively build subdirectories of exegesis target libs using llvm_target_exegesis, which is derived from llvm_targets, and is the list that can vary based on the downstream user.

I verified this builds with and without `Mips` in the `DEFAULT_TARGETS` configure list, and also double checked with `bazel query --output=build @llvm-project//llvm:Exegesis` that `lib/Mips/Target.cpp` is being included if and only if `Mips` is in the target list.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D134512

More information about the All-commits mailing list