[tint] Require WGSL and SPIR-V for all benchmarks
This simplifies the change to the benchmark framework logic that will
be added in the next CL.
Splitting this out to its own CL because the auto-generated changes
are very noisy and this should make the next CL easier to review.
Bug: 42251293
Change-Id: I6cecce8023894d10e978b0207562ca4562571cba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/200516
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/BUILD.gn b/src/tint/BUILD.gn
index aa2a940..759e566 100644
--- a/src/tint/BUILD.gn
+++ b/src/tint/BUILD.gn
@@ -380,7 +380,8 @@
group("benchmarks") {
testonly = true
deps = []
- if (tint_build_benchmarks) {
+ if (tint_build_benchmarks && tint_build_spv_reader &&
+ tint_build_wgsl_reader && tint_build_wgsl_writer) {
deps += [ "${tint_src_dir}/cmd/bench:bench_cmd" ]
}
}
diff --git a/src/tint/cmd/bench/BUILD.bazel b/src/tint/cmd/bench/BUILD.bazel
index 743f284..6afd083 100644
--- a/src/tint/cmd/bench/BUILD.bazel
+++ b/src/tint/cmd/bench/BUILD.bazel
@@ -96,7 +96,6 @@
"main_bench.cc",
],
deps = [
- "//src/tint/cmd/bench:bench",
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/type",
@@ -122,32 +121,37 @@
"//src/tint/utils/traits",
"@benchmark",
] + select({
- ":tint_build_glsl_writer": [
+ ":tint_build_glsl_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer": [
"//src/tint/lang/glsl/writer:bench",
],
"//conditions:default": [],
}) + select({
- ":tint_build_hlsl_writer": [
+ ":tint_build_hlsl_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer": [
"//src/tint/lang/hlsl/writer:bench",
],
"//conditions:default": [],
}) + select({
- ":tint_build_msl_writer": [
+ ":tint_build_msl_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer": [
"//src/tint/lang/msl/writer:bench",
],
"//conditions:default": [],
}) + select({
- ":tint_build_spv_writer": [
+ ":tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer": [
+ "//src/tint/cmd/bench:bench",
+ ],
+ "//conditions:default": [],
+ }) + select({
+ ":tint_build_spv_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer": [
"//src/tint/lang/spirv/writer:bench",
],
"//conditions:default": [],
}) + select({
- ":tint_build_wgsl_reader": [
+ ":tint_build_wgsl_reader_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer": [
"//src/tint/lang/wgsl/reader:bench",
],
"//conditions:default": [],
}) + select({
- ":tint_build_wgsl_writer": [
+ ":tint_build_wgsl_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer": [
"//src/tint/lang/wgsl/writer:bench",
],
"//conditions:default": [],
@@ -191,3 +195,66 @@
actual = "//src/tint:tint_build_wgsl_writer_true",
)
+selects.config_setting_group(
+ name = "tint_build_glsl_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_glsl_writer",
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+selects.config_setting_group(
+ name = "tint_build_hlsl_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_hlsl_writer",
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+selects.config_setting_group(
+ name = "tint_build_msl_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_msl_writer",
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+selects.config_setting_group(
+ name = "tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+selects.config_setting_group(
+ name = "tint_build_spv_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_spv_writer",
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+selects.config_setting_group(
+ name = "tint_build_wgsl_reader_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_wgsl_reader",
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+selects.config_setting_group(
+ name = "tint_build_wgsl_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_wgsl_writer",
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+
diff --git a/src/tint/cmd/bench/BUILD.cfg b/src/tint/cmd/bench/BUILD.cfg
index d496390..a1d4182 100644
--- a/src/tint/cmd/bench/BUILD.cfg
+++ b/src/tint/cmd/bench/BUILD.cfg
@@ -1,4 +1,5 @@
{
+ "Condition": "tint_build_spv_reader && tint_build_wgsl_reader && tint_build_wgsl_writer",
"bench_cmd": {
/* The benchmarks executable target for Tint. */
"OutputName": "tint_benchmark",
diff --git a/src/tint/cmd/bench/BUILD.cmake b/src/tint/cmd/bench/BUILD.cmake
index cdc5971..aa9d473 100644
--- a/src/tint/cmd/bench/BUILD.cmake
+++ b/src/tint/cmd/bench/BUILD.cmake
@@ -34,16 +34,17 @@
# Do not modify this file directly
################################################################################
+if(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
################################################################################
# Target: tint_cmd_bench_bench_cmd
# Kind: bench_cmd
+# Condition: TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER
################################################################################
tint_add_target(tint_cmd_bench_bench_cmd bench_cmd
cmd/bench/main_bench.cc
)
tint_target_add_dependencies(tint_cmd_bench_bench_cmd bench_cmd
- tint_cmd_bench_bench
tint_lang_core
tint_lang_core_constant
tint_lang_core_type
@@ -73,47 +74,56 @@
"google-benchmark"
)
-if(TINT_BUILD_GLSL_WRITER)
+if(TINT_BUILD_GLSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
tint_target_add_dependencies(tint_cmd_bench_bench_cmd bench_cmd
tint_lang_glsl_writer_bench
)
-endif(TINT_BUILD_GLSL_WRITER)
+endif(TINT_BUILD_GLSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
-if(TINT_BUILD_HLSL_WRITER)
+if(TINT_BUILD_HLSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
tint_target_add_dependencies(tint_cmd_bench_bench_cmd bench_cmd
tint_lang_hlsl_writer_bench
)
-endif(TINT_BUILD_HLSL_WRITER)
+endif(TINT_BUILD_HLSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
-if(TINT_BUILD_MSL_WRITER)
+if(TINT_BUILD_MSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
tint_target_add_dependencies(tint_cmd_bench_bench_cmd bench_cmd
tint_lang_msl_writer_bench
)
-endif(TINT_BUILD_MSL_WRITER)
+endif(TINT_BUILD_MSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
-if(TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+ tint_target_add_dependencies(tint_cmd_bench_bench_cmd bench_cmd
+ tint_cmd_bench_bench
+ )
+endif(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+
+if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
tint_target_add_dependencies(tint_cmd_bench_bench_cmd bench_cmd
tint_lang_spirv_writer_bench
)
-endif(TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
-if(TINT_BUILD_WGSL_READER)
+if(TINT_BUILD_WGSL_READER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
tint_target_add_dependencies(tint_cmd_bench_bench_cmd bench_cmd
tint_lang_wgsl_reader_bench
)
-endif(TINT_BUILD_WGSL_READER)
+endif(TINT_BUILD_WGSL_READER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
-if(TINT_BUILD_WGSL_WRITER)
+if(TINT_BUILD_WGSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
tint_target_add_dependencies(tint_cmd_bench_bench_cmd bench_cmd
tint_lang_wgsl_writer_bench
)
-endif(TINT_BUILD_WGSL_WRITER)
+endif(TINT_BUILD_WGSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
tint_target_set_output_name(tint_cmd_bench_bench_cmd bench_cmd "tint_benchmark")
+endif(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+if(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
################################################################################
# Target: tint_cmd_bench_bench
# Kind: bench
+# Condition: TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER
################################################################################
tint_add_target(tint_cmd_bench_bench bench
cmd/bench/bench.cc
@@ -170,3 +180,5 @@
tint_lang_wgsl_writer
)
endif(TINT_BUILD_WGSL_WRITER)
+
+endif(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
\ No newline at end of file
diff --git a/src/tint/cmd/bench/BUILD.gn b/src/tint/cmd/bench/BUILD.gn
index 38bdc6a..329bec4 100644
--- a/src/tint/cmd/bench/BUILD.gn
+++ b/src/tint/cmd/bench/BUILD.gn
@@ -42,111 +42,127 @@
import("//testing/test.gni")
}
if (tint_build_benchmarks) {
- tint_unittests_source_set("bench") {
- sources = [
- "bench.cc",
- "bench.h",
- ]
- deps = [
- "${tint_src_dir}:google_benchmark",
- "${tint_src_dir}/api/common",
- "${tint_src_dir}/lang/core",
- "${tint_src_dir}/lang/core/constant",
- "${tint_src_dir}/lang/core/ir",
- "${tint_src_dir}/lang/core/type",
- "${tint_src_dir}/lang/wgsl",
- "${tint_src_dir}/lang/wgsl/ast",
- "${tint_src_dir}/lang/wgsl/common",
- "${tint_src_dir}/lang/wgsl/features",
- "${tint_src_dir}/lang/wgsl/program",
- "${tint_src_dir}/lang/wgsl/sem",
- "${tint_src_dir}/lang/wgsl/writer/ir_to_program",
- "${tint_src_dir}/utils/containers",
- "${tint_src_dir}/utils/diagnostic",
- "${tint_src_dir}/utils/ice",
- "${tint_src_dir}/utils/id",
- "${tint_src_dir}/utils/macros",
- "${tint_src_dir}/utils/math",
- "${tint_src_dir}/utils/memory",
- "${tint_src_dir}/utils/reflection",
- "${tint_src_dir}/utils/result",
- "${tint_src_dir}/utils/rtti",
- "${tint_src_dir}/utils/symbol",
- "${tint_src_dir}/utils/text",
- "${tint_src_dir}/utils/traits",
- ]
-
- if (tint_build_spv_reader) {
- deps += [
- "${tint_src_dir}/lang/spirv/reader",
- "${tint_src_dir}/lang/spirv/reader/common",
+ if (tint_build_spv_reader && tint_build_wgsl_reader &&
+ tint_build_wgsl_writer) {
+ tint_unittests_source_set("bench") {
+ sources = [
+ "bench.cc",
+ "bench.h",
]
- }
+ deps = [
+ "${tint_src_dir}:google_benchmark",
+ "${tint_src_dir}/api/common",
+ "${tint_src_dir}/lang/core",
+ "${tint_src_dir}/lang/core/constant",
+ "${tint_src_dir}/lang/core/ir",
+ "${tint_src_dir}/lang/core/type",
+ "${tint_src_dir}/lang/wgsl",
+ "${tint_src_dir}/lang/wgsl/ast",
+ "${tint_src_dir}/lang/wgsl/common",
+ "${tint_src_dir}/lang/wgsl/features",
+ "${tint_src_dir}/lang/wgsl/program",
+ "${tint_src_dir}/lang/wgsl/sem",
+ "${tint_src_dir}/lang/wgsl/writer/ir_to_program",
+ "${tint_src_dir}/utils/containers",
+ "${tint_src_dir}/utils/diagnostic",
+ "${tint_src_dir}/utils/ice",
+ "${tint_src_dir}/utils/id",
+ "${tint_src_dir}/utils/macros",
+ "${tint_src_dir}/utils/math",
+ "${tint_src_dir}/utils/memory",
+ "${tint_src_dir}/utils/reflection",
+ "${tint_src_dir}/utils/result",
+ "${tint_src_dir}/utils/rtti",
+ "${tint_src_dir}/utils/symbol",
+ "${tint_src_dir}/utils/text",
+ "${tint_src_dir}/utils/traits",
+ ]
- if (tint_build_wgsl_reader) {
- deps += [ "${tint_src_dir}/lang/wgsl/reader" ]
- }
+ if (tint_build_spv_reader) {
+ deps += [
+ "${tint_src_dir}/lang/spirv/reader",
+ "${tint_src_dir}/lang/spirv/reader/common",
+ ]
+ }
- if (tint_build_wgsl_writer) {
- deps += [ "${tint_src_dir}/lang/wgsl/writer" ]
+ if (tint_build_wgsl_reader) {
+ deps += [ "${tint_src_dir}/lang/wgsl/reader" ]
+ }
+
+ if (tint_build_wgsl_writer) {
+ deps += [ "${tint_src_dir}/lang/wgsl/writer" ]
+ }
}
}
}
if (tint_build_benchmarks) {
- test("bench_cmd") {
- testonly = true
- output_name = "tint_benchmark"
- sources = [ "main_bench.cc" ]
- deps = [
- "${tint_src_dir}:google_benchmark",
- "${tint_src_dir}/cmd/bench:bench",
- "${tint_src_dir}/lang/core",
- "${tint_src_dir}/lang/core:bench",
- "${tint_src_dir}/lang/core/constant",
- "${tint_src_dir}/lang/core/type",
- "${tint_src_dir}/lang/wgsl",
- "${tint_src_dir}/lang/wgsl:bench",
- "${tint_src_dir}/lang/wgsl/ast",
- "${tint_src_dir}/lang/wgsl/program",
- "${tint_src_dir}/lang/wgsl/sem",
- "${tint_src_dir}/utils/containers",
- "${tint_src_dir}/utils/diagnostic",
- "${tint_src_dir}/utils/ice",
- "${tint_src_dir}/utils/id",
- "${tint_src_dir}/utils/macros",
- "${tint_src_dir}/utils/math",
- "${tint_src_dir}/utils/memory",
- "${tint_src_dir}/utils/reflection",
- "${tint_src_dir}/utils/result",
- "${tint_src_dir}/utils/rtti",
- "${tint_src_dir}/utils/rtti:bench",
- "${tint_src_dir}/utils/symbol",
- "${tint_src_dir}/utils/text",
- "${tint_src_dir}/utils/traits",
- ]
+ if (tint_build_spv_reader && tint_build_wgsl_reader &&
+ tint_build_wgsl_writer) {
+ test("bench_cmd") {
+ testonly = true
+ output_name = "tint_benchmark"
+ sources = [ "main_bench.cc" ]
+ deps = [
+ "${tint_src_dir}:google_benchmark",
+ "${tint_src_dir}/lang/core",
+ "${tint_src_dir}/lang/core:bench",
+ "${tint_src_dir}/lang/core/constant",
+ "${tint_src_dir}/lang/core/type",
+ "${tint_src_dir}/lang/wgsl",
+ "${tint_src_dir}/lang/wgsl:bench",
+ "${tint_src_dir}/lang/wgsl/ast",
+ "${tint_src_dir}/lang/wgsl/program",
+ "${tint_src_dir}/lang/wgsl/sem",
+ "${tint_src_dir}/utils/containers",
+ "${tint_src_dir}/utils/diagnostic",
+ "${tint_src_dir}/utils/ice",
+ "${tint_src_dir}/utils/id",
+ "${tint_src_dir}/utils/macros",
+ "${tint_src_dir}/utils/math",
+ "${tint_src_dir}/utils/memory",
+ "${tint_src_dir}/utils/reflection",
+ "${tint_src_dir}/utils/result",
+ "${tint_src_dir}/utils/rtti",
+ "${tint_src_dir}/utils/rtti:bench",
+ "${tint_src_dir}/utils/symbol",
+ "${tint_src_dir}/utils/text",
+ "${tint_src_dir}/utils/traits",
+ ]
- if (tint_build_glsl_writer) {
- deps += [ "${tint_src_dir}/lang/glsl/writer:bench" ]
- }
+ if (tint_build_glsl_writer && tint_build_spv_reader &&
+ tint_build_wgsl_reader && tint_build_wgsl_writer) {
+ deps += [ "${tint_src_dir}/lang/glsl/writer:bench" ]
+ }
- if (tint_build_hlsl_writer) {
- deps += [ "${tint_src_dir}/lang/hlsl/writer:bench" ]
- }
+ if (tint_build_hlsl_writer && tint_build_spv_reader &&
+ tint_build_wgsl_reader && tint_build_wgsl_writer) {
+ deps += [ "${tint_src_dir}/lang/hlsl/writer:bench" ]
+ }
- if (tint_build_msl_writer) {
- deps += [ "${tint_src_dir}/lang/msl/writer:bench" ]
- }
+ if (tint_build_msl_writer && tint_build_spv_reader &&
+ tint_build_wgsl_reader && tint_build_wgsl_writer) {
+ deps += [ "${tint_src_dir}/lang/msl/writer:bench" ]
+ }
- if (tint_build_spv_writer) {
- deps += [ "${tint_src_dir}/lang/spirv/writer:bench" ]
- }
+ if (tint_build_spv_reader && tint_build_wgsl_reader &&
+ tint_build_wgsl_writer) {
+ deps += [ "${tint_src_dir}/cmd/bench:bench" ]
+ }
- if (tint_build_wgsl_reader) {
- deps += [ "${tint_src_dir}/lang/wgsl/reader:bench" ]
- }
+ if (tint_build_spv_writer && tint_build_spv_reader &&
+ tint_build_wgsl_reader && tint_build_wgsl_writer) {
+ deps += [ "${tint_src_dir}/lang/spirv/writer:bench" ]
+ }
- if (tint_build_wgsl_writer) {
- deps += [ "${tint_src_dir}/lang/wgsl/writer:bench" ]
+ if (tint_build_wgsl_reader && tint_build_spv_reader &&
+ tint_build_wgsl_reader && tint_build_wgsl_writer) {
+ deps += [ "${tint_src_dir}/lang/wgsl/reader:bench" ]
+ }
+
+ if (tint_build_wgsl_writer && tint_build_spv_reader &&
+ tint_build_wgsl_reader && tint_build_wgsl_writer) {
+ deps += [ "${tint_src_dir}/lang/wgsl/writer:bench" ]
+ }
}
}
}
diff --git a/src/tint/lang/glsl/writer/BUILD.bazel b/src/tint/lang/glsl/writer/BUILD.bazel
index 78b509d..751ec84 100644
--- a/src/tint/lang/glsl/writer/BUILD.bazel
+++ b/src/tint/lang/glsl/writer/BUILD.bazel
@@ -91,7 +91,6 @@
],
deps = [
"//src/tint/api/common",
- "//src/tint/cmd/bench:bench",
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/type",
@@ -121,6 +120,11 @@
"//src/tint/lang/glsl/writer/common",
],
"//conditions:default": [],
+ }) + select({
+ ":tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer": [
+ "//src/tint/cmd/bench:bench",
+ ],
+ "//conditions:default": [],
}),
copts = COPTS,
visibility = ["//visibility:public"],
@@ -132,7 +136,35 @@
)
alias(
+ name = "tint_build_spv_reader",
+ actual = "//src/tint:tint_build_spv_reader_true",
+)
+
+alias(
name = "tint_build_wgsl_reader",
actual = "//src/tint:tint_build_wgsl_reader_true",
)
+alias(
+ name = "tint_build_wgsl_writer",
+ actual = "//src/tint:tint_build_wgsl_writer_true",
+)
+
+selects.config_setting_group(
+ name = "tint_build_glsl_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_glsl_writer",
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+selects.config_setting_group(
+ name = "tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+
diff --git a/src/tint/lang/glsl/writer/BUILD.cfg b/src/tint/lang/glsl/writer/BUILD.cfg
index 7459430..b8552be 100644
--- a/src/tint/lang/glsl/writer/BUILD.cfg
+++ b/src/tint/lang/glsl/writer/BUILD.cfg
@@ -1,3 +1,6 @@
{
- "condition": "tint_build_glsl_writer"
+ "condition": "tint_build_glsl_writer",
+ "bench": {
+ "Condition": "tint_build_spv_reader && tint_build_wgsl_reader && tint_build_wgsl_writer",
+ }
}
diff --git a/src/tint/lang/glsl/writer/BUILD.cmake b/src/tint/lang/glsl/writer/BUILD.cmake
index e80c329..1d3b921 100644
--- a/src/tint/lang/glsl/writer/BUILD.cmake
+++ b/src/tint/lang/glsl/writer/BUILD.cmake
@@ -91,11 +91,11 @@
endif(TINT_BUILD_GLSL_WRITER)
endif(TINT_BUILD_GLSL_WRITER)
-if(TINT_BUILD_GLSL_WRITER)
+if(TINT_BUILD_GLSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
################################################################################
# Target: tint_lang_glsl_writer_bench
# Kind: bench
-# Condition: TINT_BUILD_GLSL_WRITER
+# Condition: TINT_BUILD_GLSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER
################################################################################
tint_add_target(tint_lang_glsl_writer_bench bench
lang/glsl/writer/writer_bench.cc
@@ -103,7 +103,6 @@
tint_target_add_dependencies(tint_lang_glsl_writer_bench bench
tint_api_common
- tint_cmd_bench_bench
tint_lang_core
tint_lang_core_constant
tint_lang_core_type
@@ -139,7 +138,13 @@
)
endif(TINT_BUILD_GLSL_WRITER)
-endif(TINT_BUILD_GLSL_WRITER)
+if(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+ tint_target_add_dependencies(tint_lang_glsl_writer_bench bench
+ tint_cmd_bench_bench
+ )
+endif(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+
+endif(TINT_BUILD_GLSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
if(TINT_BUILD_GLSL_WRITER)
################################################################################
# Target: tint_lang_glsl_writer_fuzz
diff --git a/src/tint/lang/glsl/writer/BUILD.gn b/src/tint/lang/glsl/writer/BUILD.gn
index 84f331c..830c65c 100644
--- a/src/tint/lang/glsl/writer/BUILD.gn
+++ b/src/tint/lang/glsl/writer/BUILD.gn
@@ -87,13 +87,13 @@
}
}
if (tint_build_benchmarks) {
- if (tint_build_glsl_writer) {
+ if (tint_build_glsl_writer && tint_build_spv_reader &&
+ tint_build_wgsl_reader && tint_build_wgsl_writer) {
tint_unittests_source_set("bench") {
sources = [ "writer_bench.cc" ]
deps = [
"${tint_src_dir}:google_benchmark",
"${tint_src_dir}/api/common",
- "${tint_src_dir}/cmd/bench:bench",
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/type",
@@ -124,6 +124,11 @@
"${tint_src_dir}/lang/glsl/writer/common",
]
}
+
+ if (tint_build_spv_reader && tint_build_wgsl_reader &&
+ tint_build_wgsl_writer) {
+ deps += [ "${tint_src_dir}/cmd/bench:bench" ]
+ }
}
}
}
diff --git a/src/tint/lang/hlsl/writer/BUILD.bazel b/src/tint/lang/hlsl/writer/BUILD.bazel
index b66d284..87bc86c 100644
--- a/src/tint/lang/hlsl/writer/BUILD.bazel
+++ b/src/tint/lang/hlsl/writer/BUILD.bazel
@@ -147,7 +147,6 @@
],
deps = [
"//src/tint/api/common",
- "//src/tint/cmd/bench:bench",
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/type",
@@ -175,6 +174,11 @@
"//src/tint/lang/hlsl/writer",
],
"//conditions:default": [],
+ }) + select({
+ ":tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer": [
+ "//src/tint/cmd/bench:bench",
+ ],
+ "//conditions:default": [],
}),
copts = COPTS,
visibility = ["//visibility:public"],
@@ -186,7 +190,35 @@
)
alias(
+ name = "tint_build_spv_reader",
+ actual = "//src/tint:tint_build_spv_reader_true",
+)
+
+alias(
name = "tint_build_wgsl_reader",
actual = "//src/tint:tint_build_wgsl_reader_true",
)
+alias(
+ name = "tint_build_wgsl_writer",
+ actual = "//src/tint:tint_build_wgsl_writer_true",
+)
+
+selects.config_setting_group(
+ name = "tint_build_hlsl_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_hlsl_writer",
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+selects.config_setting_group(
+ name = "tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+
diff --git a/src/tint/lang/hlsl/writer/BUILD.cfg b/src/tint/lang/hlsl/writer/BUILD.cfg
index 31b4636..5d85a91 100644
--- a/src/tint/lang/hlsl/writer/BUILD.cfg
+++ b/src/tint/lang/hlsl/writer/BUILD.cfg
@@ -1,3 +1,6 @@
{
- "condition": "tint_build_hlsl_writer"
+ "condition": "tint_build_hlsl_writer",
+ "bench": {
+ "Condition": "tint_build_spv_reader && tint_build_wgsl_reader && tint_build_wgsl_writer",
+ }
}
diff --git a/src/tint/lang/hlsl/writer/BUILD.cmake b/src/tint/lang/hlsl/writer/BUILD.cmake
index 1113e5f..04927f5 100644
--- a/src/tint/lang/hlsl/writer/BUILD.cmake
+++ b/src/tint/lang/hlsl/writer/BUILD.cmake
@@ -154,11 +154,11 @@
endif(TINT_BUILD_HLSL_WRITER)
endif(TINT_BUILD_HLSL_WRITER)
-if(TINT_BUILD_HLSL_WRITER)
+if(TINT_BUILD_HLSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
################################################################################
# Target: tint_lang_hlsl_writer_bench
# Kind: bench
-# Condition: TINT_BUILD_HLSL_WRITER
+# Condition: TINT_BUILD_HLSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER
################################################################################
tint_add_target(tint_lang_hlsl_writer_bench bench
lang/hlsl/writer/writer_bench.cc
@@ -166,7 +166,6 @@
tint_target_add_dependencies(tint_lang_hlsl_writer_bench bench
tint_api_common
- tint_cmd_bench_bench
tint_lang_core
tint_lang_core_constant
tint_lang_core_type
@@ -200,7 +199,13 @@
)
endif(TINT_BUILD_HLSL_WRITER)
-endif(TINT_BUILD_HLSL_WRITER)
+if(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+ tint_target_add_dependencies(tint_lang_hlsl_writer_bench bench
+ tint_cmd_bench_bench
+ )
+endif(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+
+endif(TINT_BUILD_HLSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
if(TINT_BUILD_HLSL_WRITER)
################################################################################
# Target: tint_lang_hlsl_writer_fuzz
diff --git a/src/tint/lang/hlsl/writer/BUILD.gn b/src/tint/lang/hlsl/writer/BUILD.gn
index 13709f4..c7f164d 100644
--- a/src/tint/lang/hlsl/writer/BUILD.gn
+++ b/src/tint/lang/hlsl/writer/BUILD.gn
@@ -144,13 +144,13 @@
}
}
if (tint_build_benchmarks) {
- if (tint_build_hlsl_writer) {
+ if (tint_build_hlsl_writer && tint_build_spv_reader &&
+ tint_build_wgsl_reader && tint_build_wgsl_writer) {
tint_unittests_source_set("bench") {
sources = [ "writer_bench.cc" ]
deps = [
"${tint_src_dir}:google_benchmark",
"${tint_src_dir}/api/common",
- "${tint_src_dir}/cmd/bench:bench",
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/type",
@@ -177,6 +177,11 @@
if (tint_build_hlsl_writer) {
deps += [ "${tint_src_dir}/lang/hlsl/writer" ]
}
+
+ if (tint_build_spv_reader && tint_build_wgsl_reader &&
+ tint_build_wgsl_writer) {
+ deps += [ "${tint_src_dir}/cmd/bench:bench" ]
+ }
}
}
}
diff --git a/src/tint/lang/msl/writer/BUILD.bazel b/src/tint/lang/msl/writer/BUILD.bazel
index d6bc3ab..e2e42b1 100644
--- a/src/tint/lang/msl/writer/BUILD.bazel
+++ b/src/tint/lang/msl/writer/BUILD.bazel
@@ -139,7 +139,6 @@
],
deps = [
"//src/tint/api/common",
- "//src/tint/cmd/bench:bench",
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/type",
@@ -169,6 +168,11 @@
"//src/tint/lang/msl/writer/helpers",
],
"//conditions:default": [],
+ }) + select({
+ ":tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer": [
+ "//src/tint/cmd/bench:bench",
+ ],
+ "//conditions:default": [],
}),
copts = COPTS,
visibility = ["//visibility:public"],
@@ -180,7 +184,35 @@
)
alias(
+ name = "tint_build_spv_reader",
+ actual = "//src/tint:tint_build_spv_reader_true",
+)
+
+alias(
name = "tint_build_wgsl_reader",
actual = "//src/tint:tint_build_wgsl_reader_true",
)
+alias(
+ name = "tint_build_wgsl_writer",
+ actual = "//src/tint:tint_build_wgsl_writer_true",
+)
+
+selects.config_setting_group(
+ name = "tint_build_msl_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_msl_writer",
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+selects.config_setting_group(
+ name = "tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+
diff --git a/src/tint/lang/msl/writer/BUILD.cfg b/src/tint/lang/msl/writer/BUILD.cfg
index 1c7e256..ef68502 100644
--- a/src/tint/lang/msl/writer/BUILD.cfg
+++ b/src/tint/lang/msl/writer/BUILD.cfg
@@ -1,3 +1,6 @@
{
- "condition": "tint_build_msl_writer"
+ "condition": "tint_build_msl_writer",
+ "bench": {
+ "Condition": "tint_build_spv_reader && tint_build_wgsl_reader && tint_build_wgsl_writer",
+ }
}
diff --git a/src/tint/lang/msl/writer/BUILD.cmake b/src/tint/lang/msl/writer/BUILD.cmake
index 6a95a37..b6c00cb 100644
--- a/src/tint/lang/msl/writer/BUILD.cmake
+++ b/src/tint/lang/msl/writer/BUILD.cmake
@@ -146,11 +146,11 @@
endif(TINT_BUILD_MSL_WRITER)
endif(TINT_BUILD_MSL_WRITER)
-if(TINT_BUILD_MSL_WRITER)
+if(TINT_BUILD_MSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
################################################################################
# Target: tint_lang_msl_writer_bench
# Kind: bench
-# Condition: TINT_BUILD_MSL_WRITER
+# Condition: TINT_BUILD_MSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER
################################################################################
tint_add_target(tint_lang_msl_writer_bench bench
lang/msl/writer/writer_bench.cc
@@ -158,7 +158,6 @@
tint_target_add_dependencies(tint_lang_msl_writer_bench bench
tint_api_common
- tint_cmd_bench_bench
tint_lang_core
tint_lang_core_constant
tint_lang_core_type
@@ -194,7 +193,13 @@
)
endif(TINT_BUILD_MSL_WRITER)
-endif(TINT_BUILD_MSL_WRITER)
+if(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+ tint_target_add_dependencies(tint_lang_msl_writer_bench bench
+ tint_cmd_bench_bench
+ )
+endif(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+
+endif(TINT_BUILD_MSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
if(TINT_BUILD_MSL_WRITER)
################################################################################
# Target: tint_lang_msl_writer_fuzz
diff --git a/src/tint/lang/msl/writer/BUILD.gn b/src/tint/lang/msl/writer/BUILD.gn
index eff79a3..ab97d19 100644
--- a/src/tint/lang/msl/writer/BUILD.gn
+++ b/src/tint/lang/msl/writer/BUILD.gn
@@ -136,13 +136,13 @@
}
}
if (tint_build_benchmarks) {
- if (tint_build_msl_writer) {
+ if (tint_build_msl_writer && tint_build_spv_reader &&
+ tint_build_wgsl_reader && tint_build_wgsl_writer) {
tint_unittests_source_set("bench") {
sources = [ "writer_bench.cc" ]
deps = [
"${tint_src_dir}:google_benchmark",
"${tint_src_dir}/api/common",
- "${tint_src_dir}/cmd/bench:bench",
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/type",
@@ -173,6 +173,11 @@
"${tint_src_dir}/lang/msl/writer/helpers",
]
}
+
+ if (tint_build_spv_reader && tint_build_wgsl_reader &&
+ tint_build_wgsl_writer) {
+ deps += [ "${tint_src_dir}/cmd/bench:bench" ]
+ }
}
}
}
diff --git a/src/tint/lang/spirv/writer/BUILD.bazel b/src/tint/lang/spirv/writer/BUILD.bazel
index b4b14e7..2590c24 100644
--- a/src/tint/lang/spirv/writer/BUILD.bazel
+++ b/src/tint/lang/spirv/writer/BUILD.bazel
@@ -160,7 +160,6 @@
],
deps = [
"//src/tint/api/common",
- "//src/tint/cmd/bench:bench",
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/ir",
@@ -186,6 +185,11 @@
"//src/tint/utils/traits",
"@benchmark",
] + select({
+ ":tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer": [
+ "//src/tint/cmd/bench:bench",
+ ],
+ "//conditions:default": [],
+ }) + select({
":tint_build_spv_writer": [
"//src/tint/lang/spirv/writer",
"//src/tint/lang/spirv/writer/common",
@@ -216,6 +220,11 @@
actual = "//src/tint:tint_build_wgsl_reader_true",
)
+alias(
+ name = "tint_build_wgsl_writer",
+ actual = "//src/tint:tint_build_wgsl_writer_true",
+)
+
selects.config_setting_group(
name = "tint_build_spv_reader_or_tint_build_spv_writer",
match_any = [
@@ -224,3 +233,21 @@
],
)
+selects.config_setting_group(
+ name = "tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+selects.config_setting_group(
+ name = "tint_build_spv_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_spv_writer",
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+
diff --git a/src/tint/lang/spirv/writer/BUILD.cfg b/src/tint/lang/spirv/writer/BUILD.cfg
index 0a24987..9f5ef38 100644
--- a/src/tint/lang/spirv/writer/BUILD.cfg
+++ b/src/tint/lang/spirv/writer/BUILD.cfg
@@ -1,3 +1,6 @@
{
- "condition": "tint_build_spv_writer"
+ "condition": "tint_build_spv_writer",
+ "bench": {
+ "Condition": "tint_build_spv_reader && tint_build_wgsl_reader && tint_build_wgsl_writer",
+ }
}
diff --git a/src/tint/lang/spirv/writer/BUILD.cmake b/src/tint/lang/spirv/writer/BUILD.cmake
index b86e1c2..402cbf5 100644
--- a/src/tint/lang/spirv/writer/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/BUILD.cmake
@@ -169,11 +169,11 @@
endif(TINT_BUILD_SPV_WRITER)
endif(TINT_BUILD_SPV_WRITER)
-if(TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
################################################################################
# Target: tint_lang_spirv_writer_bench
# Kind: bench
-# Condition: TINT_BUILD_SPV_WRITER
+# Condition: TINT_BUILD_SPV_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER
################################################################################
tint_add_target(tint_lang_spirv_writer_bench bench
lang/spirv/writer/writer_bench.cc
@@ -181,7 +181,6 @@
tint_target_add_dependencies(tint_lang_spirv_writer_bench bench
tint_api_common
- tint_cmd_bench_bench
tint_lang_core
tint_lang_core_constant
tint_lang_core_ir
@@ -211,6 +210,12 @@
"google-benchmark"
)
+if(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+ tint_target_add_dependencies(tint_lang_spirv_writer_bench bench
+ tint_cmd_bench_bench
+ )
+endif(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+
if(TINT_BUILD_SPV_WRITER)
tint_target_add_dependencies(tint_lang_spirv_writer_bench bench
tint_lang_spirv_writer
@@ -224,7 +229,7 @@
)
endif(TINT_BUILD_WGSL_READER)
-endif(TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
if(TINT_BUILD_SPV_WRITER)
################################################################################
# Target: tint_lang_spirv_writer_fuzz
diff --git a/src/tint/lang/spirv/writer/BUILD.gn b/src/tint/lang/spirv/writer/BUILD.gn
index cd75026..e7bd0e5 100644
--- a/src/tint/lang/spirv/writer/BUILD.gn
+++ b/src/tint/lang/spirv/writer/BUILD.gn
@@ -158,13 +158,13 @@
}
}
if (tint_build_benchmarks) {
- if (tint_build_spv_writer) {
+ if (tint_build_spv_writer && tint_build_spv_reader &&
+ tint_build_wgsl_reader && tint_build_wgsl_writer) {
tint_unittests_source_set("bench") {
sources = [ "writer_bench.cc" ]
deps = [
"${tint_src_dir}:google_benchmark",
"${tint_src_dir}/api/common",
- "${tint_src_dir}/cmd/bench:bench",
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/ir",
@@ -190,6 +190,11 @@
"${tint_src_dir}/utils/traits",
]
+ if (tint_build_spv_reader && tint_build_wgsl_reader &&
+ tint_build_wgsl_writer) {
+ deps += [ "${tint_src_dir}/cmd/bench:bench" ]
+ }
+
if (tint_build_spv_writer) {
deps += [
"${tint_src_dir}/lang/spirv/writer",
diff --git a/src/tint/lang/wgsl/reader/BUILD.bazel b/src/tint/lang/wgsl/reader/BUILD.bazel
index cd62211..f395a97 100644
--- a/src/tint/lang/wgsl/reader/BUILD.bazel
+++ b/src/tint/lang/wgsl/reader/BUILD.bazel
@@ -121,7 +121,6 @@
],
deps = [
"//src/tint/api/common",
- "//src/tint/cmd/bench:bench",
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/ir",
@@ -147,6 +146,11 @@
"//src/tint/utils/traits",
"@benchmark",
] + select({
+ ":tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer": [
+ "//src/tint/cmd/bench:bench",
+ ],
+ "//conditions:default": [],
+ }) + select({
":tint_build_wgsl_reader": [
"//src/tint/lang/wgsl/reader",
],
@@ -157,7 +161,35 @@
)
alias(
+ name = "tint_build_spv_reader",
+ actual = "//src/tint:tint_build_spv_reader_true",
+)
+
+alias(
name = "tint_build_wgsl_reader",
actual = "//src/tint:tint_build_wgsl_reader_true",
)
+alias(
+ name = "tint_build_wgsl_writer",
+ actual = "//src/tint:tint_build_wgsl_writer_true",
+)
+
+selects.config_setting_group(
+ name = "tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+selects.config_setting_group(
+ name = "tint_build_wgsl_reader_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_wgsl_reader",
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+
diff --git a/src/tint/lang/wgsl/reader/BUILD.cfg b/src/tint/lang/wgsl/reader/BUILD.cfg
index e85bddd..43eb7d1 100644
--- a/src/tint/lang/wgsl/reader/BUILD.cfg
+++ b/src/tint/lang/wgsl/reader/BUILD.cfg
@@ -1,3 +1,6 @@
{
"condition": "tint_build_wgsl_reader",
+ "bench": {
+ "Condition": "tint_build_spv_reader && tint_build_wgsl_reader && tint_build_wgsl_writer",
+ }
}
diff --git a/src/tint/lang/wgsl/reader/BUILD.cmake b/src/tint/lang/wgsl/reader/BUILD.cmake
index 7fe11c5..d9829a4 100644
--- a/src/tint/lang/wgsl/reader/BUILD.cmake
+++ b/src/tint/lang/wgsl/reader/BUILD.cmake
@@ -125,11 +125,11 @@
endif(TINT_BUILD_WGSL_READER)
endif(TINT_BUILD_WGSL_READER)
-if(TINT_BUILD_WGSL_READER)
+if(TINT_BUILD_WGSL_READER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
################################################################################
# Target: tint_lang_wgsl_reader_bench
# Kind: bench
-# Condition: TINT_BUILD_WGSL_READER
+# Condition: TINT_BUILD_WGSL_READER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER
################################################################################
tint_add_target(tint_lang_wgsl_reader_bench bench
lang/wgsl/reader/reader_bench.cc
@@ -137,7 +137,6 @@
tint_target_add_dependencies(tint_lang_wgsl_reader_bench bench
tint_api_common
- tint_cmd_bench_bench
tint_lang_core
tint_lang_core_constant
tint_lang_core_ir
@@ -167,10 +166,16 @@
"google-benchmark"
)
+if(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+ tint_target_add_dependencies(tint_lang_wgsl_reader_bench bench
+ tint_cmd_bench_bench
+ )
+endif(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+
if(TINT_BUILD_WGSL_READER)
tint_target_add_dependencies(tint_lang_wgsl_reader_bench bench
tint_lang_wgsl_reader
)
endif(TINT_BUILD_WGSL_READER)
-endif(TINT_BUILD_WGSL_READER)
\ No newline at end of file
+endif(TINT_BUILD_WGSL_READER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
\ No newline at end of file
diff --git a/src/tint/lang/wgsl/reader/BUILD.gn b/src/tint/lang/wgsl/reader/BUILD.gn
index c0b7243..26601c7 100644
--- a/src/tint/lang/wgsl/reader/BUILD.gn
+++ b/src/tint/lang/wgsl/reader/BUILD.gn
@@ -114,13 +114,13 @@
}
}
if (tint_build_benchmarks) {
- if (tint_build_wgsl_reader) {
+ if (tint_build_wgsl_reader && tint_build_spv_reader &&
+ tint_build_wgsl_reader && tint_build_wgsl_writer) {
tint_unittests_source_set("bench") {
sources = [ "reader_bench.cc" ]
deps = [
"${tint_src_dir}:google_benchmark",
"${tint_src_dir}/api/common",
- "${tint_src_dir}/cmd/bench:bench",
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/ir",
@@ -146,6 +146,11 @@
"${tint_src_dir}/utils/traits",
]
+ if (tint_build_spv_reader && tint_build_wgsl_reader &&
+ tint_build_wgsl_writer) {
+ deps += [ "${tint_src_dir}/cmd/bench:bench" ]
+ }
+
if (tint_build_wgsl_reader) {
deps += [ "${tint_src_dir}/lang/wgsl/reader" ]
}
diff --git a/src/tint/lang/wgsl/writer/BUILD.bazel b/src/tint/lang/wgsl/writer/BUILD.bazel
index 23adfef..4010fac 100644
--- a/src/tint/lang/wgsl/writer/BUILD.bazel
+++ b/src/tint/lang/wgsl/writer/BUILD.bazel
@@ -139,7 +139,6 @@
"writer_bench.cc",
],
deps = [
- "//src/tint/cmd/bench:bench",
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/type",
@@ -165,6 +164,11 @@
"//src/tint/utils/traits",
"@benchmark",
] + select({
+ ":tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer": [
+ "//src/tint/cmd/bench:bench",
+ ],
+ "//conditions:default": [],
+ }) + select({
":tint_build_wgsl_writer": [
"//src/tint/lang/wgsl/writer",
],
@@ -175,6 +179,11 @@
)
alias(
+ name = "tint_build_spv_reader",
+ actual = "//src/tint:tint_build_spv_reader_true",
+)
+
+alias(
name = "tint_build_wgsl_reader",
actual = "//src/tint:tint_build_wgsl_reader_true",
)
@@ -184,3 +193,21 @@
actual = "//src/tint:tint_build_wgsl_writer_true",
)
+selects.config_setting_group(
+ name = "tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+selects.config_setting_group(
+ name = "tint_build_wgsl_writer_and_tint_build_spv_reader_and_tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_wgsl_writer",
+ ":tint_build_spv_reader",
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+
diff --git a/src/tint/lang/wgsl/writer/BUILD.cfg b/src/tint/lang/wgsl/writer/BUILD.cfg
index 80e6a14..25214e3 100644
--- a/src/tint/lang/wgsl/writer/BUILD.cfg
+++ b/src/tint/lang/wgsl/writer/BUILD.cfg
@@ -1,3 +1,6 @@
{
- "condition": "tint_build_wgsl_writer"
+ "condition": "tint_build_wgsl_writer",
+ "bench": {
+ "Condition": "tint_build_spv_reader && tint_build_wgsl_reader && tint_build_wgsl_writer",
+ }
}
diff --git a/src/tint/lang/wgsl/writer/BUILD.cmake b/src/tint/lang/wgsl/writer/BUILD.cmake
index 5ca9163..dc8f327 100644
--- a/src/tint/lang/wgsl/writer/BUILD.cmake
+++ b/src/tint/lang/wgsl/writer/BUILD.cmake
@@ -145,18 +145,17 @@
endif(TINT_BUILD_WGSL_WRITER)
endif(TINT_BUILD_WGSL_WRITER)
-if(TINT_BUILD_WGSL_WRITER)
+if(TINT_BUILD_WGSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
################################################################################
# Target: tint_lang_wgsl_writer_bench
# Kind: bench
-# Condition: TINT_BUILD_WGSL_WRITER
+# Condition: TINT_BUILD_WGSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER
################################################################################
tint_add_target(tint_lang_wgsl_writer_bench bench
lang/wgsl/writer/writer_bench.cc
)
tint_target_add_dependencies(tint_lang_wgsl_writer_bench bench
- tint_cmd_bench_bench
tint_lang_core
tint_lang_core_constant
tint_lang_core_type
@@ -186,13 +185,19 @@
"google-benchmark"
)
+if(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+ tint_target_add_dependencies(tint_lang_wgsl_writer_bench bench
+ tint_cmd_bench_bench
+ )
+endif(TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+
if(TINT_BUILD_WGSL_WRITER)
tint_target_add_dependencies(tint_lang_wgsl_writer_bench bench
tint_lang_wgsl_writer
)
endif(TINT_BUILD_WGSL_WRITER)
-endif(TINT_BUILD_WGSL_WRITER)
+endif(TINT_BUILD_WGSL_WRITER AND TINT_BUILD_SPV_READER AND TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
if(TINT_BUILD_WGSL_WRITER)
################################################################################
# Target: tint_lang_wgsl_writer_fuzz
diff --git a/src/tint/lang/wgsl/writer/BUILD.gn b/src/tint/lang/wgsl/writer/BUILD.gn
index 14ebcde..d3c44ff 100644
--- a/src/tint/lang/wgsl/writer/BUILD.gn
+++ b/src/tint/lang/wgsl/writer/BUILD.gn
@@ -133,12 +133,12 @@
}
}
if (tint_build_benchmarks) {
- if (tint_build_wgsl_writer) {
+ if (tint_build_wgsl_writer && tint_build_spv_reader &&
+ tint_build_wgsl_reader && tint_build_wgsl_writer) {
tint_unittests_source_set("bench") {
sources = [ "writer_bench.cc" ]
deps = [
"${tint_src_dir}:google_benchmark",
- "${tint_src_dir}/cmd/bench:bench",
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/type",
@@ -164,6 +164,11 @@
"${tint_src_dir}/utils/traits",
]
+ if (tint_build_spv_reader && tint_build_wgsl_reader &&
+ tint_build_wgsl_writer) {
+ deps += [ "${tint_src_dir}/cmd/bench:bench" ]
+ }
+
if (tint_build_wgsl_writer) {
deps += [ "${tint_src_dir}/lang/wgsl/writer" ]
}