[PATCH] D107019: [Bazel] Derive targets from file presence as in CMake build
Geoffrey Martin-Noble via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 29 18:11:05 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6fa2d0fbf463: [Bazel] Derive targets from file presence as in CMake build (authored by GMNGeoffrey).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107019/new/
https://reviews.llvm.org/D107019
Files:
utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
Index: utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
===================================================================
--- utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+++ utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
@@ -33,30 +33,27 @@
targets = llvm_targets,
)
+# Enabled targets with ASM printers.
+llvm_target_asm_printers = [
+ t
+ for t in llvm_targets
+ if glob(["lib/Target/{}/*AsmPrinter.cpp".format(t)])
+]
+
enum_targets_gen(
name = "asm_printers_def_gen",
src = "include/llvm/Config/AsmPrinters.def.in",
out = "include/llvm/Config/AsmPrinters.def",
macro_name = "ASM_PRINTER",
- targets = llvm_targets,
+ targets = llvm_target_asm_printers,
)
-# TODO(gcmn): We should derive these lists from the presence of CMakeLists.txt
-# files, as is done in the CMake build.
-# List of targets with ASM parsers, filtered to our list of overall targets.
-llvm_target_asm_parsers = [t for t in [
- "AArch64",
- "AMDGPU",
- "ARM",
- "BPF",
- "Hexagon",
- "Lanai",
- "PowerPC",
- "RISCV",
- "Sparc",
- "WebAssembly",
- "X86",
-] if t in llvm_targets]
+# Enabled targets with ASM parsers.
+llvm_target_asm_parsers = [
+ t
+ for t in llvm_targets
+ if glob(["lib/Target/{}/AsmParser/CMakeLists.txt".format(t)])
+]
enum_targets_gen(
name = "asm_parsers_def_gen",
@@ -66,20 +63,12 @@
targets = llvm_target_asm_parsers,
)
-# List of targets with disassemblers, filtered to our list of overall targets.
-llvm_target_disassemblers = [t for t in [
- "AArch64",
- "AMDGPU",
- "ARM",
- "BPF",
- "Hexagon",
- "Lanai",
- "PowerPC",
- "RISCV",
- "Sparc",
- "WebAssembly",
- "X86",
-] if t in llvm_targets]
+# Enabled targets with disassemblers.
+llvm_target_disassemblers = [
+ t
+ for t in llvm_targets
+ if glob(["lib/Target/{}/Disassembler/CMakeLists.txt".format(t)])
+]
enum_targets_gen(
name = "disassemblers_def_gen",
@@ -89,10 +78,12 @@
targets = llvm_target_disassemblers,
)
-# List of targets with mca, filtered to our list of overall targets.
-llvm_target_mcas = [t for t in [
- "AMDGPU",
-] if t in llvm_targets]
+# Enabled targets with MCA.
+llvm_target_mcas = [
+ t
+ for t in llvm_targets
+ if glob(["lib/Target/{}/MCA/CMakeLists.txt".format(t)])
+]
enum_targets_gen(
name = "target_mca_def_gen",
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107019.362939.patch
Type: text/x-patch
Size: 2394 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210730/7ca51abd/attachment.bin>
More information about the llvm-commits
mailing list