Skip to content

Commit e20a261

Browse files
authored
[bazel] More port of #148286: only include spirv dep when enabled (#153531)
The fix in #153520 works so long as SPIRV is actually an enabled target. Otherwise, the build fails w/ `target 'SPIRVCodeGen' not declared in package ...`
1 parent af06835 commit e20a261

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
99
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
1010
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
11+
load("//llvm:targets.bzl", "llvm_targets")
1112
load(
1213
":build_defs.bzl",
1314
"cc_headers_only",
@@ -13839,11 +13840,13 @@ cc_library(
1383913840
"//llvm:BitWriter",
1384013841
"//llvm:Core",
1384113842
"//llvm:Object",
13842-
"//llvm:SPIRVCodeGen",
1384313843
"//llvm:Support",
1384413844
"//llvm:Target",
1384513845
"//llvm:config",
13846-
],
13846+
] + ([
13847+
"//llvm:SPIRVCodeGen",
13848+
"//llvm:SPIRVUtilsAndDesc",
13849+
] if "SPIRV" in llvm_targets else []),
1384713850
)
1384813851

1384913852
cc_library(

0 commit comments

Comments
 (0)