# Copyright 2023 The Dawn & Tint Authors
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
#    list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
#    this list of conditions and the following disclaimer in the documentation
#    and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
#    contributors may be used to endorse or promote products derived from
#    this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

################################################################################
# File generated by 'tools/src/cmd/gen' using the template:
#   tools/src/cmd/gen/build/BUILD.gn.tmpl
#
# To regenerate run: './tools/run gen'
#
#                       Do not modify this file directly
################################################################################

import("../../../../../scripts/tint_overrides_with_defaults.gni")

import("${tint_src_dir}/tint.gni")
if (tint_build_wgsl_reader) {
  tint_fuzz_source_set("fuzz") {
    sources = [
      "wgsl_fuzz.cc",
      "wgsl_fuzz.h",
    ]
    deps = [
      "${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/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/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_wgsl_reader) {
  tint_fuzzer_test("wgsl") {
    output_name = "tint_wgsl_fuzzer"
    sources = [ "main_fuzz.cc" ]
    deps = [
      "${tint_src_dir}/lang/core",
      "${tint_src_dir}/lang/core/constant",
      "${tint_src_dir}/lang/core/type",
      "${tint_src_dir}/lang/wgsl",
      "${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/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}/cmd/fuzz/wgsl:fuzz",
        "${tint_src_dir}/lang/wgsl/ast/transform:fuzz",
      ]
    }
  }
}
