# Copyright 2023 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.

################################################################################
# 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) {
  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.cc",
    "builtin.h",
    "builtin_fn.cc",
    "builtin_fn.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",
    "number.cc",
    "number.h",
    "parameter_usage.cc",
    "parameter_usage.h",
    "texel_format.cc",
    "texel_format.h",
    "unary_op.cc",
    "unary_op.h",
  ]
  deps = [
    "${tint_src_dir}/utils/ice",
    "${tint_src_dir}/utils/macros",
    "${tint_src_dir}/utils/memory",
    "${tint_src_dir}/utils/result",
    "${tint_src_dir}/utils/text",
    "${tint_src_dir}/utils/traits",
  ]
}
if (tint_build_unittests) {
  tint_unittests_source_set("unittests") {
    testonly = true
    sources = [
      "access_test.cc",
      "address_space_test.cc",
      "attribute_test.cc",
      "builtin_test.cc",
      "builtin_value_test.cc",
      "interpolation_sampling_test.cc",
      "interpolation_type_test.cc",
      "number_test.cc",
      "texel_format_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/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",
    ]
  }
}
