Skip to content

Commit 23d8616

Browse files
authored
[Bazel] Generate LLVM_HAS_XYZ_TARGET macros in llvm config (#94476)
Otherwise code that depends on those targets being enabled might not get compiled correctly even if the targets are explicitly included in the configuration (in my case NVVM target for MLIR).
1 parent 61ef9fd commit 23d8616

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

utils/bazel/llvm-project-overlay/llvm/BUILD.bazel

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,18 @@ td_library(
164164
includes = ["include"],
165165
)
166166

167+
llvm_config_target_defines = [
168+
"LLVM_HAS_{}_TARGET=1".format(t) for t in llvm_targets
169+
]
170+
167171
cc_library(
168172
name = "config",
169173
hdrs = [
170174
"include/llvm/Config/abi-breaking.h",
171175
"include/llvm/Config/llvm-config.h",
172176
],
173177
copts = llvm_copts,
174-
defines = llvm_config_defines,
178+
defines = llvm_config_defines + llvm_config_target_defines,
175179
includes = ["include"],
176180
textual_hdrs = [
177181
"include/llvm/Config/AsmParsers.def",

0 commit comments

Comments
 (0)