# 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_unittests) {
  test("test_cmd") {
    testonly = true
    output_name = "tint_unittests"
    sources = [ "main_test.cc" ]
    deps = [
      "${tint_src_dir}:gmock_and_gtest",
      "${tint_src_dir}/api",
      "${tint_src_dir}/api/common:unittests",
      "${tint_src_dir}/lang/core:unittests",
      "${tint_src_dir}/lang/core/constant:unittests",
      "${tint_src_dir}/lang/core/intrinsic:unittests",
      "${tint_src_dir}/lang/core/ir:unittests",
      "${tint_src_dir}/lang/core/ir/transform:unittests",
      "${tint_src_dir}/lang/core/type:unittests",
      "${tint_src_dir}/lang/glsl/ir:unittests",
      "${tint_src_dir}/lang/hlsl/ir:unittests",
      "${tint_src_dir}/lang/hlsl/type:unittests",
      "${tint_src_dir}/lang/hlsl/writer/common:unittests",
      "${tint_src_dir}/lang/hlsl/writer/raise:unittests",
      "${tint_src_dir}/lang/msl/ir:unittests",
      "${tint_src_dir}/lang/msl/type:unittests",
      "${tint_src_dir}/lang/spirv/ir:unittests",
      "${tint_src_dir}/lang/spirv/reader/lower:unittests",
      "${tint_src_dir}/lang/spirv/type:unittests",
      "${tint_src_dir}/lang/wgsl:unittests",
      "${tint_src_dir}/lang/wgsl/ast:unittests",
      "${tint_src_dir}/lang/wgsl/common:unittests",
      "${tint_src_dir}/lang/wgsl/helpers:unittests",
      "${tint_src_dir}/lang/wgsl/intrinsic:unittests",
      "${tint_src_dir}/lang/wgsl/program:unittests",
      "${tint_src_dir}/lang/wgsl/reader/lower:unittests",
      "${tint_src_dir}/lang/wgsl/resolver:unittests",
      "${tint_src_dir}/lang/wgsl/sem:unittests",
      "${tint_src_dir}/lang/wgsl/writer/ir_to_program:unittests",
      "${tint_src_dir}/lang/wgsl/writer/raise:unittests",
      "${tint_src_dir}/utils/bytes:unittests",
      "${tint_src_dir}/utils/cli:unittests",
      "${tint_src_dir}/utils/command:unittests",
      "${tint_src_dir}/utils/containers:unittests",
      "${tint_src_dir}/utils/diagnostic:unittests",
      "${tint_src_dir}/utils/file:unittests",
      "${tint_src_dir}/utils/ice:unittests",
      "${tint_src_dir}/utils/macros:unittests",
      "${tint_src_dir}/utils/math:unittests",
      "${tint_src_dir}/utils/memory:unittests",
      "${tint_src_dir}/utils/reflection:unittests",
      "${tint_src_dir}/utils/result:unittests",
      "${tint_src_dir}/utils/rtti:unittests",
      "${tint_src_dir}/utils/strconv:unittests",
      "${tint_src_dir}/utils/symbol:unittests",
      "${tint_src_dir}/utils/text:unittests",
      "${tint_src_dir}/utils/traits:unittests",
    ]

    if (tint_build_glsl_writer) {
      deps += [
        "${tint_src_dir}/lang/glsl/writer/common:unittests",
        "${tint_src_dir}/lang/glsl/writer/raise:unittests",
      ]
    }

    if (tint_build_glsl_writer && tint_build_glsl_validator) {
      deps += [ "${tint_src_dir}/lang/glsl/writer:unittests" ]
    }

    if (tint_build_hlsl_writer) {
      deps += [
        "${tint_src_dir}/lang/hlsl/writer:unittests",
        "${tint_src_dir}/lang/hlsl/writer/ast_printer:unittests",
      ]
    }

    if (tint_build_hlsl_writer && tint_build_wgsl_reader &&
        tint_build_wgsl_writer) {
      deps += [ "${tint_src_dir}/lang/hlsl/writer/ast_raise:unittests" ]
    }

    if (tint_build_ir_binary) {
      deps += [ "${tint_src_dir}/lang/core/ir/binary:unittests" ]
    }

    if (tint_build_msl_writer) {
      deps += [
        "${tint_src_dir}/lang/msl/writer:unittests",
        "${tint_src_dir}/lang/msl/writer/ast_printer:unittests",
        "${tint_src_dir}/lang/msl/writer/common:unittests",
        "${tint_src_dir}/lang/msl/writer/raise:unittests",
      ]
    }

    if (tint_build_msl_writer && tint_build_wgsl_reader &&
        tint_build_wgsl_writer) {
      deps += [ "${tint_src_dir}/lang/msl/writer/ast_raise:unittests" ]
    }

    if (tint_build_spv_reader) {
      deps += [
        "${tint_src_dir}/lang/spirv/reader:unittests",
        "${tint_src_dir}/lang/spirv/reader/common:unittests",
        "${tint_src_dir}/lang/spirv/reader/parser:unittests",
      ]
    }

    if (tint_build_spv_reader && tint_build_wgsl_reader &&
        tint_build_wgsl_writer) {
      deps += [ "${tint_src_dir}/lang/spirv/reader/ast_lower:unittests" ]
    }

    if (tint_build_spv_reader && tint_build_wgsl_writer) {
      deps += [ "${tint_src_dir}/lang/spirv/reader/ast_parser:unittests" ]
    }

    if (tint_build_spv_reader || tint_build_spv_writer) {
      deps += [ "${tint_src_dir}/lang/spirv/validate:unittests" ]
    }

    if (tint_build_spv_writer) {
      deps += [
        "${tint_src_dir}/lang/spirv/writer:unittests",
        "${tint_src_dir}/lang/spirv/writer/common:unittests",
        "${tint_src_dir}/lang/spirv/writer/raise:unittests",
      ]
    }

    if (tint_build_tintd && tint_build_wgsl_reader) {
      deps += [ "${tint_src_dir}/lang/wgsl/ls:unittests" ]
    }

    if (tint_build_wgsl_reader) {
      deps += [
        "${tint_src_dir}/lang/wgsl/inspector:unittests",
        "${tint_src_dir}/lang/wgsl/reader:unittests",
        "${tint_src_dir}/lang/wgsl/reader/parser:unittests",
        "${tint_src_dir}/lang/wgsl/reader/program_to_ir:unittests",
      ]
    }

    if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
      deps += [ "${tint_src_dir}/lang/wgsl/ast/transform:unittests" ]
    }

    if (tint_build_wgsl_writer) {
      deps += [
        "${tint_src_dir}/lang/wgsl/writer:unittests",
        "${tint_src_dir}/lang/wgsl/writer/ast_printer:unittests",
      ]
    }
    configs += [ "${tint_src_dir}:tint_unittests_config" ]

    if (build_with_chromium) {
      configs -= [ "//build/config/compiler:chromium_code" ]
      configs += [ "//build/config/compiler:no_chromium_code" ]
    }
  }
}
