# 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_msl_writer) {
  libtint_source_set("raise") {
    sources = [
      "builtin_polyfill.cc",
      "builtin_polyfill.h",
      "module_scope_vars.cc",
      "module_scope_vars.h",
      "raise.cc",
      "raise.h",
      "shader_io.cc",
      "shader_io.h",
    ]
    deps = [
      "${tint_src_dir}/api/common",
      "${tint_src_dir}/lang/core",
      "${tint_src_dir}/lang/core/common",
      "${tint_src_dir}/lang/core/constant",
      "${tint_src_dir}/lang/core/intrinsic",
      "${tint_src_dir}/lang/core/ir",
      "${tint_src_dir}/lang/core/ir/transform",
      "${tint_src_dir}/lang/core/ir/transform/common",
      "${tint_src_dir}/lang/core/type",
      "${tint_src_dir}/lang/msl",
      "${tint_src_dir}/lang/msl/intrinsic",
      "${tint_src_dir}/lang/msl/ir",
      "${tint_src_dir}/lang/msl/type",
      "${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_msl_writer) {
      deps += [ "${tint_src_dir}/lang/msl/writer/common" ]
    }
  }
}
if (tint_build_unittests) {
  if (tint_build_msl_writer) {
    tint_unittests_source_set("unittests") {
      sources = [
        "builtin_polyfill_test.cc",
        "module_scope_vars_test.cc",
        "shader_io_test.cc",
      ]
      deps = [
        "${tint_src_dir}:gmock_and_gtest",
        "${tint_src_dir}/api/common",
        "${tint_src_dir}/lang/core",
        "${tint_src_dir}/lang/core/constant",
        "${tint_src_dir}/lang/core/intrinsic",
        "${tint_src_dir}/lang/core/ir",
        "${tint_src_dir}/lang/core/ir/transform:unittests",
        "${tint_src_dir}/lang/core/type",
        "${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_msl_writer) {
        deps += [ "${tint_src_dir}/lang/msl/writer/raise" ]
      }
    }
  }
}
