Skip to content

Commit

Permalink
[gn] Add new groups() for various targets, grouped by target kind.
Browse files Browse the repository at this point in the history
Will simplify the chromium dependencies.

Also add an output name to the WGSL fuzzer.

Change-Id: If1b83569a3e22b23a090d2607042eb11d613ad24
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/155440
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
  • Loading branch information
ben-clayton authored and Dawn LUCI CQ committed Oct 10, 2023
1 parent 366fba9 commit d283e95
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 21 deletions.
49 changes: 33 additions & 16 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,52 @@
import("scripts/dawn_overrides_with_defaults.gni")
import("scripts/tint_overrides_with_defaults.gni")

group("benchmarks") {
testonly = true
deps = [ "src/tint:benchmarks" ]
}

group("fuzzers") {
testonly = true
deps = [
"src/dawn/fuzzers",
"src/tint/cmd/fuzz/wgsl",
"src/tint/fuzzers",
"src/tint:fuzzers",
]
}

group("libs") {
deps = [
"src/dawn/native:webgpu_dawn",
"src/tint:libs",
]
}

group("tests") {
testonly = true
deps = [
"src/dawn/tests",
"src/tint:tests",
]
}

group("cmds") {
deps = [
"src/dawn/samples",
"src/tint:cmds",
]
}

group("all") {
testonly = true
deps = [
":benchmarks",
":fuzzers",
"src/dawn/native:webgpu_dawn",
"src/dawn/tests",
"src/tint/api",
":libs",
":tests",
]
if (tint_build_unittests) {
deps += [ "src/tint/cmd/test:test_cmd" ]
}
if (tint_build_benchmarks) {
deps += [ "src/tint/cmd/bench:bench_cmd" ]
}

if (dawn_standalone) {
deps += [
"src/dawn/samples",
"src/tint/cmd/remote_compile",
"src/tint/cmd/tint",
]
deps += [ ":cmds" ]
}
}

Expand Down
49 changes: 44 additions & 5 deletions src/tint/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,50 @@ if (tint_has_fuzzers) {
}

###############################################################################
# Aliases
# Groups
###############################################################################
if (tint_build_unittests) {
group("tint_unittests") {
testonly = true
public_deps = [ "${tint_src_dir}/cmd/test:test_cmd" ]
group("libs") {
deps = [ "${tint_src_dir}/api" ]
}

group("cmds") {
deps = [ "${tint_src_dir}/cmd/tint" ]
if (dawn_standalone) {
deps += [ "${tint_src_dir}/cmd/remote_compile" ]
}
}

group("fuzzers") {
testonly = true
deps = []
if (tint_has_fuzzers) {
deps += [
"${tint_src_dir}/cmd/fuzz/wgsl",
"${tint_src_dir}/fuzzers",
]
}
}

group("tests") {
testonly = true
deps = []
if (tint_build_unittests) {
deps += [ "${tint_src_dir}/cmd/test:test_cmd" ]
}
}

group("benchmarks") {
testonly = true
deps = []
if (tint_build_benchmarks) {
deps += [ "${tint_src_dir}/cmd/bench:bench_cmd" ]
}
}

###############################################################################
# Aliases
###############################################################################
group("tint_unittests") {
testonly = true
public_deps = [ ":tests" ]
}
11 changes: 11 additions & 0 deletions src/tint/cmd/fuzz/wgsl/BUILD.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"fuzz_cmd": {
/* The Tint fuzzer executable for WGSL-input. */
"OutputName": "tint_wgsl_fuzzer",
"AdditionalDependencies": {
/* Depend on all the fuzz targets to pull them all together. */
"Internal": [ "**:fuzz" ]
}
}
}

2 changes: 2 additions & 0 deletions src/tint/cmd/fuzz/wgsl/BUILD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ tint_target_add_dependencies(tint_cmd_fuzz_wgsl_fuzz_cmd fuzz_cmd
tint_utils_traits
)

tint_target_set_output_name(tint_cmd_fuzz_wgsl_fuzz_cmd fuzz_cmd "tint_wgsl_fuzzer")

################################################################################
# Target: tint_cmd_fuzz_wgsl_fuzz
# Kind: fuzz
Expand Down
1 change: 1 addition & 0 deletions src/tint/cmd/fuzz/wgsl/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ tint_fuzz_source_set("fuzz") {
}

tint_fuzzer_test("wgsl") {
output_name = "tint_wgsl_fuzzer"
sources = [ "main_fuzz.cc" ]
deps = [
"${tint_src_dir}/cmd/fuzz/wgsl:fuzz",
Expand Down

0 comments on commit d283e95

Please sign in to comment.