# 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")
}
if (tint_build_wgsl_reader) {
  libtint_source_set("parser") {
    sources = [
      "classify_template_args.cc",
      "classify_template_args.h",
      "detail.h",
      "lexer.cc",
      "lexer.h",
      "parser.cc",
      "parser.h",
      "token.cc",
      "token.h",
    ]
    deps = [
      "${dawn_root}/src/utils:utils",
      "${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/common",
      "${tint_src_dir}/lang/wgsl/features",
      "${tint_src_dir}/lang/wgsl/program",
      "${tint_src_dir}/lang/wgsl/resolver",
      "${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/strconv",
      "${tint_src_dir}/utils/symbol",
      "${tint_src_dir}/utils/text",
      "${tint_src_dir}/utils/traits",
    ]
  }
}
if (tint_build_unittests) {
  if (tint_build_wgsl_reader) {
    tint_unittests_source_set("unittests") {
      sources = [
        "additive_expression_test.cc",
        "argument_expression_list_test.cc",
        "assignment_stmt_test.cc",
        "bitwise_expression_test.cc",
        "break_stmt_test.cc",
        "bug_cases_test.cc",
        "call_stmt_test.cc",
        "classify_template_args_test.cc",
        "compound_stmt_test.cc",
        "const_literal_test.cc",
        "continue_stmt_test.cc",
        "continuing_stmt_test.cc",
        "core_lhs_expression_test.cc",
        "diagnostic_attribute_test.cc",
        "diagnostic_control_test.cc",
        "diagnostic_directive_test.cc",
        "enable_directive_test.cc",
        "error_msg_test.cc",
        "error_resync_test.cc",
        "expression_test.cc",
        "for_stmt_test.cc",
        "function_attribute_list_test.cc",
        "function_attribute_test.cc",
        "function_decl_test.cc",
        "function_header_test.cc",
        "global_constant_decl_test.cc",
        "global_decl_test.cc",
        "global_variable_decl_test.cc",
        "helper_test.cc",
        "helper_test.h",
        "if_stmt_test.cc",
        "increment_decrement_stmt_test.cc",
        "lexer_test.cc",
        "lhs_expression_test.cc",
        "loop_stmt_test.cc",
        "math_expression_test.cc",
        "multiplicative_expression_test.cc",
        "param_list_test.cc",
        "paren_expression_test.cc",
        "parser_test.cc",
        "primary_expression_test.cc",
        "relational_expression_test.cc",
        "require_directive_test.cc",
        "reserved_keyword_test.cc",
        "shift_expression_test.cc",
        "singular_expression_test.cc",
        "statement_test.cc",
        "statements_test.cc",
        "struct_attribute_decl_test.cc",
        "struct_body_decl_test.cc",
        "struct_decl_test.cc",
        "struct_member_attribute_decl_test.cc",
        "struct_member_attribute_test.cc",
        "struct_member_test.cc",
        "switch_body_test.cc",
        "switch_stmt_test.cc",
        "token_test.cc",
        "type_alias_test.cc",
        "type_decl_test.cc",
        "unary_expression_test.cc",
        "variable_attribute_list_test.cc",
        "variable_attribute_test.cc",
        "variable_decl_test.cc",
        "variable_ident_decl_test.cc",
        "variable_qualifier_test.cc",
        "variable_stmt_test.cc",
        "while_stmt_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/ast:unittests",
        "${tint_src_dir}/lang/wgsl/common",
        "${tint_src_dir}/lang/wgsl/features",
        "${tint_src_dir}/lang/wgsl/program",
        "${tint_src_dir}/lang/wgsl/resolver",
        "${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/parser" ]
      }
    }
  }
}
