# 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/dawn_overrides_with_defaults.gni")
import("../../../../scripts/tint_overrides_with_defaults.gni")

import("${tint_src_dir}/tint.gni")

if (tint_build_unittests || tint_build_benchmarks) {
  import("//testing/test.gni")
}

libtint_source_set("core") {
  sources = [
    "access.cc",
    "access.h",
    "address_space.cc",
    "address_space.h",
    "attribute.cc",
    "attribute.h",
    "binary_op.cc",
    "binary_op.h",
    "builtin_fn.cc",
    "builtin_fn.h",
    "builtin_type.cc",
    "builtin_type.h",
    "builtin_value.cc",
    "builtin_value.h",
    "evaluation_stage.h",
    "fluent_types.h",
    "interpolation.h",
    "interpolation_sampling.cc",
    "interpolation_sampling.h",
    "interpolation_type.cc",
    "interpolation_type.h",
    "io_attributes.h",
    "number.cc",
    "number.h",
    "parameter_usage.cc",
    "parameter_usage.h",
    "subgroup_matrix_kind.cc",
    "subgroup_matrix_kind.h",
    "texel_format.cc",
    "texel_format.h",
    "unary_op.cc",
    "unary_op.h",
  ]
  deps = [
    "${dawn_root}/src/utils:utils",
    "${tint_src_dir}/utils/containers",
    "${tint_src_dir}/utils/diagnostic",
    "${tint_src_dir}/utils/ice",
    "${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/text",
    "${tint_src_dir}/utils/traits",
  ]
}
if (tint_build_unittests) {
  tint_unittests_source_set("unittests") {
    sources = [
      "access_test.cc",
      "address_space_test.cc",
      "attribute_test.cc",
      "builtin_type_test.cc",
      "builtin_value_test.cc",
      "interpolation_sampling_test.cc",
      "interpolation_type_test.cc",
      "number_test.cc",
      "texel_format_test.cc",
    ]
    deps = [
      "${dawn_root}/src/utils:utils",
      "${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/type",
      "${tint_src_dir}/lang/wgsl",
      "${tint_src_dir}/lang/wgsl/ast",
      "${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/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_benchmarks) {
  tint_benchmarks_source_set("bench") {
    sources = [
      "access_bench.cc",
      "address_space_bench.cc",
      "attribute_bench.cc",
      "builtin_type_bench.cc",
      "builtin_value_bench.cc",
      "interpolation_sampling_bench.cc",
      "interpolation_type_bench.cc",
      "texel_format_bench.cc",
    ]
    deps = [
      "${dawn_root}/src/utils:utils",
      "${tint_src_dir}:google_benchmark",
      "${tint_src_dir}/lang/core",
      "${tint_src_dir}/utils/containers",
      "${tint_src_dir}/utils/diagnostic",
      "${tint_src_dir}/utils/ice",
      "${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/text",
      "${tint_src_dir}/utils/traits",
    ]
  }
}
