# 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_unittests || tint_build_benchmarks) {
  import("//testing/test.gni")
}
if (tint_build_hlsl_writer) {
  libtint_source_set("writer") {
    sources = [
      "output.cc",
      "output.h",
      "writer.cc",
      "writer.h",
    ]
    deps = [
      "${tint_src_dir}/api/common",
      "${tint_src_dir}/api/options",
      "${tint_src_dir}/lang/core",
      "${tint_src_dir}/lang/core/constant",
      "${tint_src_dir}/lang/core/type",
      "${tint_src_dir}/lang/hlsl/writer/common",
      "${tint_src_dir}/lang/wgsl",
      "${tint_src_dir}/lang/wgsl/ast",
      "${tint_src_dir}/lang/wgsl/ast/transform",
      "${tint_src_dir}/lang/wgsl/features",
      "${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/generator",
      "${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_hlsl_writer) {
      deps += [
        "${tint_src_dir}/lang/hlsl/writer/ast_printer",
        "${tint_src_dir}/lang/hlsl/writer/ast_raise",
      ]
    }
  }
}
if (tint_build_benchmarks) {
  if (tint_build_hlsl_writer) {
    tint_unittests_source_set("bench") {
      sources = [ "writer_bench.cc" ]
      deps = [
        "${tint_src_dir}:google_benchmark",
        "${tint_src_dir}/api/common",
        "${tint_src_dir}/api/options",
        "${tint_src_dir}/cmd/bench:bench",
        "${tint_src_dir}/lang/core",
        "${tint_src_dir}/lang/core/constant",
        "${tint_src_dir}/lang/core/type",
        "${tint_src_dir}/lang/hlsl/writer/common",
        "${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_hlsl_writer) {
        deps += [ "${tint_src_dir}/lang/hlsl/writer" ]
      }
    }
  }
}
if (tint_build_hlsl_writer) {
  tint_fuzz_source_set("fuzz") {
    sources = []
    deps = [
      "${tint_src_dir}/api/common",
      "${tint_src_dir}/api/options",
      "${tint_src_dir}/lang/core",
      "${tint_src_dir}/lang/core/constant",
      "${tint_src_dir}/lang/core/type",
      "${tint_src_dir}/lang/hlsl/writer/common",
      "${tint_src_dir}/lang/wgsl",
      "${tint_src_dir}/lang/wgsl/ast",
      "${tint_src_dir}/lang/wgsl/ast/transform",
      "${tint_src_dir}/lang/wgsl/features",
      "${tint_src_dir}/lang/wgsl/program",
      "${tint_src_dir}/lang/wgsl/sem",
      "${tint_src_dir}/utils/bytes",
      "${tint_src_dir}/utils/command",
      "${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_hlsl_writer) {
      deps += [
        "${tint_src_dir}/lang/hlsl/validate",
        "${tint_src_dir}/lang/hlsl/writer",
      ]
    }

    if (tint_build_wgsl_reader) {
      sources += [ "writer_ast_fuzz.cc" ]
      deps += [ "${tint_src_dir}/cmd/fuzz/wgsl:fuzz" ]
    }
  }
}
