[PATCH] D115053: [Bazel] Switch LLVM targets based on configuration flags.

Geoffrey Martin-Noble via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 9 17:48:42 PST 2021


GMNGeoffrey added inline comments.


================
Comment at: utils/bazel/llvm-project-overlay/llvm/BUILD.bazel:1775
         name = target["name"] + "Info",
         srcs = ["lib/Target/" + target["name"] + "/TargetInfo/" + target["name"] + "TargetInfo.cpp"],
         hdrs = glob(["lib/Target/" + target["name"] + "/TargetInfo/*.h"]),
----------------
izuk wrote:
> GMNGeoffrey wrote:
> > Perhaps we should select out all srcs if the target isn't enabled. Then there's no chance some other dependency is going to pull in anything from a disabled target
> Not sure I understand.  Do you mean, have the Bazel target but with an empty srcs?
Yes, exactly. The set of targets has to be static, but we could make the Bazel target a noop, so that disabling an LLVM target really guarantees it isn't built.


================
Comment at: utils/bazel/llvm-project-overlay/llvm/enum_targets_gen.bzl:53
+        for t in valid_targets
+        if is_enabled(t)
     ])
----------------
Does that work? 🤨 Selects aren't evaluated within macros (which is why this rule exists). I think you're going to end up with just "if <object>" which will always be True


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115053/new/

https://reviews.llvm.org/D115053



More information about the llvm-commits mailing list