mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-08 13:14:56 +00:00
Split BUILD.gn into per-subdirectory BUILD.gns
This will allow Tint's dependent to depend on libtint without GN discovering Tint's test and try to build them. In particular it will help use Tint in Dawn in Skia's standalone build which doesn't have //testing. Bug: dawn:706 Change-Id: Idd28662b89aa75df7704eaae205328dce0b96fef Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/44540 Reviewed-by: David Neto <dneto@google.com> Commit-Queue: Corentin Wallez <cwallez@chromium.org> Auto-Submit: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
e2bc7aa747
commit
5929a04316
191
fuzzers/BUILD.gn
Normal file
191
fuzzers/BUILD.gn
Normal file
@@ -0,0 +1,191 @@
|
||||
# Copyright 2021 The Tint Authors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//build_overrides/build.gni")
|
||||
import("../tint_overrides_with_defaults.gni")
|
||||
|
||||
# Fuzzers - Libfuzzer based fuzzing targets for Chromium
|
||||
# To run the fuzzers outside of Chromium, use the CMake based builds.
|
||||
|
||||
if (build_with_chromium) {
|
||||
import("//testing/libfuzzer/fuzzer_test.gni")
|
||||
|
||||
# fuzzer_test doesn't have configs members, so need to define them in an empty
|
||||
# source_set.
|
||||
|
||||
source_set("tint_fuzzer_common") {
|
||||
public_configs = [
|
||||
":tint_config",
|
||||
":tint_common_config",
|
||||
]
|
||||
|
||||
public_deps = [ "${tint_root_dir}/src:libtint" ]
|
||||
|
||||
sources = [
|
||||
"fuzzers/tint_common_fuzzer.cc",
|
||||
"fuzzers/tint_common_fuzzer.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (tint_build_wgsl_reader) {
|
||||
fuzzer_test("tint_wgsl_reader_fuzzer") {
|
||||
sources = [ "fuzzers/tint_wgsl_reader_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
|
||||
fuzzer_test("tint_wgsl_reader_wgsl_writer_fuzzer") {
|
||||
sources = [ "fuzzers/tint_wgsl_reader_wgsl_writer_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (tint_build_wgsl_reader && tint_build_spv_writer) {
|
||||
fuzzer_test("tint_wgsl_reader_spv_writer_fuzzer") {
|
||||
sources = [ "fuzzers/tint_wgsl_reader_spv_writer_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
|
||||
fuzzer_test("tint_all_transforms_fuzzer") {
|
||||
sources = [ "fuzzers/tint_all_transforms_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
|
||||
fuzzer_test("tint_bound_array_accessors_fuzzer") {
|
||||
sources = [ "fuzzers/tint_bound_array_accessors_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
|
||||
fuzzer_test("tint_emit_vertex_point_size_fuzzer") {
|
||||
sources = [ "fuzzers/tint_emit_vertex_point_size_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
|
||||
fuzzer_test("tint_first_index_offset_fuzzer") {
|
||||
sources = [ "fuzzers/tint_first_index_offset_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
|
||||
fuzzer_test("tint_inspector_fuzzer") {
|
||||
sources = [ "fuzzers/tint_inspector_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (tint_build_wgsl_reader && tint_build_hlsl_writer) {
|
||||
fuzzer_test("tint_wgsl_reader_hlsl_writer_fuzzer") {
|
||||
sources = [ "fuzzers/tint_wgsl_reader_hlsl_writer_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (tint_build_wgsl_reader && tint_build_msl_writer) {
|
||||
fuzzer_test("tint_wgsl_reader_msl_writer_fuzzer") {
|
||||
sources = [ "fuzzers/tint_wgsl_reader_msl_writer_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (tint_build_spv_reader) {
|
||||
fuzzer_test("tint_spv_reader_fuzzer") {
|
||||
sources = [ "fuzzers/tint_spv_reader_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (tint_build_spv_reader && tint_build_wgsl_writer) {
|
||||
fuzzer_test("tint_spv_reader_wgsl_writer_fuzzer") {
|
||||
sources = [ "fuzzers/tint_spv_reader_wgsl_writer_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (tint_build_spv_reader && tint_build_spv_writer) {
|
||||
fuzzer_test("tint_spv_reader_spv_writer_fuzzer") {
|
||||
sources = [ "fuzzers/tint_spv_reader_spv_writer_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (tint_build_spv_reader && tint_build_hlsl_writer) {
|
||||
fuzzer_test("tint_spv_reader_hlsl_writer_fuzzer") {
|
||||
sources = [ "fuzzers/tint_spv_reader_hlsl_writer_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (tint_build_spv_reader && tint_build_msl_writer) {
|
||||
fuzzer_test("tint_spv_reader_msl_writer_fuzzer") {
|
||||
sources = [ "fuzzers/tint_spv_reader_msl_writer_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
|
||||
fuzzer_test("tint_ast_clone_fuzzer") {
|
||||
sources = [ "fuzzers/tint_ast_clone_fuzzer.cc" ]
|
||||
deps = [ ":tint_fuzzer_common" ]
|
||||
}
|
||||
}
|
||||
|
||||
group("fuzzers") {
|
||||
testonly = true
|
||||
deps = []
|
||||
|
||||
if (tint_build_wgsl_reader) {
|
||||
deps += [ ":tint_wgsl_reader_fuzzer" ]
|
||||
}
|
||||
if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
|
||||
deps += [ ":tint_wgsl_reader_wgsl_writer_fuzzer" ]
|
||||
}
|
||||
if (tint_build_wgsl_reader && tint_build_spv_writer) {
|
||||
deps += [
|
||||
":tint_all_transforms_fuzzer",
|
||||
":tint_bound_array_accessors_fuzzer",
|
||||
":tint_emit_vertex_point_size_fuzzer",
|
||||
":tint_first_index_offset_fuzzer",
|
||||
":tint_inspector_fuzzer",
|
||||
":tint_wgsl_reader_spv_writer_fuzzer",
|
||||
]
|
||||
}
|
||||
if (tint_build_wgsl_reader && tint_build_hlsl_writer) {
|
||||
deps += [ ":tint_wgsl_reader_hlsl_writer_fuzzer" ]
|
||||
}
|
||||
if (tint_build_wgsl_reader && tint_build_msl_writer) {
|
||||
deps += [ ":tint_wgsl_reader_msl_writer_fuzzer" ]
|
||||
}
|
||||
if (tint_build_spv_reader) {
|
||||
deps += [ ":tint_spv_reader_fuzzer" ]
|
||||
}
|
||||
if (tint_build_spv_reader && tint_build_wgsl_writer) {
|
||||
deps += [ ":tint_spv_reader_wgsl_writer_fuzzer" ]
|
||||
}
|
||||
if (tint_build_spv_reader && tint_build_spv_writer) {
|
||||
deps += [ ":tint_spv_reader_spv_writer_fuzzer" ]
|
||||
}
|
||||
if (tint_build_spv_reader && tint_build_hlsl_writer) {
|
||||
deps += [ ":tint_spv_reader_hlsl_writer_fuzzer" ]
|
||||
}
|
||||
if (tint_build_spv_reader && tint_build_msl_writer) {
|
||||
deps += [ ":tint_spv_reader_msl_writer_fuzzer" ]
|
||||
}
|
||||
if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
|
||||
deps += [ ":tint_ast_clone_fuzzer" ]
|
||||
}
|
||||
}
|
||||
} else {
|
||||
group("fuzzers") {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user