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

# GEN_BUILD:DO_NOT_GENERATE - Don't regenerate this file with `./tools run gen`

import("//build_overrides/build.gni")

import("../../scripts/dawn_overrides_with_defaults.gni")
import("../../scripts/tint_overrides_with_defaults.gni")

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

import("tint.gni")

###############################################################################
# Common - Configs, etc. shared across targets
###############################################################################

# tint_gen_dir is the relative path of tint_root_dir to '//', under root_gen_dir
tint_gen_dir = "${root_gen_dir}/" + rebase_path("${tint_root_dir}", "//")

config("tint_common_config") {
  include_dirs = [
    "${tint_root_dir}",
    "${tint_gen_dir}",
  ]

  # Some versions of MSVC ignores the [[noreturn]] on ~InternalCompilerError(),
  # triggering a warning if it is the last statement on a function that has a
  # return value.
  if (!is_clang && is_win) {
    cflags = [ "/wd4715" ]
  }
}

config("tint_public_config") {
  defines = []
  if (tint_build_spv_reader) {
    defines += [ "TINT_BUILD_SPV_READER=1" ]
  } else {
    defines += [ "TINT_BUILD_SPV_READER=0" ]
  }

  if (tint_build_spv_writer) {
    defines += [ "TINT_BUILD_SPV_WRITER=1" ]
  } else {
    defines += [ "TINT_BUILD_SPV_WRITER=0" ]
  }

  if (tint_build_wgsl_reader) {
    defines += [ "TINT_BUILD_WGSL_READER=1" ]
  } else {
    defines += [ "TINT_BUILD_WGSL_READER=0" ]
  }

  if (tint_build_wgsl_writer) {
    defines += [ "TINT_BUILD_WGSL_WRITER=1" ]
  } else {
    defines += [ "TINT_BUILD_WGSL_WRITER=0" ]
  }

  if (tint_build_msl_writer) {
    defines += [ "TINT_BUILD_MSL_WRITER=1" ]
  } else {
    defines += [ "TINT_BUILD_MSL_WRITER=0" ]
  }

  if (tint_build_hlsl_writer) {
    defines += [ "TINT_BUILD_HLSL_WRITER=1" ]
  } else {
    defines += [ "TINT_BUILD_HLSL_WRITER=0" ]
  }

  if (tint_build_glsl_writer) {
    defines += [ "TINT_BUILD_GLSL_WRITER=1" ]
  } else {
    defines += [ "TINT_BUILD_GLSL_WRITER=0" ]
  }

  if (tint_build_glsl_validator) {
    defines += [ "TINT_BUILD_GLSL_VALIDATOR=1" ]
  } else {
    defines += [ "TINT_BUILD_GLSL_VALIDATOR=0" ]
  }

  if (tint_build_syntax_tree_writer) {
    defines += [ "TINT_BUILD_SYNTAX_TREE_WRITER=1" ]
  } else {
    defines += [ "TINT_BUILD_SYNTAX_TREE_WRITER=0" ]
  }

  if (tint_build_ir_binary) {
    defines += [ "TINT_BUILD_IR_BINARY=1" ]
  } else {
    defines += [ "TINT_BUILD_IR_BINARY=0" ]
  }

  if (tint_build_ir_fuzzer) {
    defines += [ "TINT_BUILD_IR_FUZZER=1" ]
  } else {
    defines += [ "TINT_BUILD_IR_FUZZER=0" ]
  }

  if (tint_build_is_win) {
    defines += [ "TINT_BUILD_IS_WIN=1" ]
  } else {
    defines += [ "TINT_BUILD_IS_WIN=0" ]
  }

  if (tint_build_is_mac) {
    defines += [ "TINT_BUILD_IS_MAC=1" ]
  } else {
    defines += [ "TINT_BUILD_IS_MAC=0" ]
  }

  if (tint_build_is_linux) {
    defines += [ "TINT_BUILD_IS_LINUX=1" ]
  } else {
    defines += [ "TINT_BUILD_IS_LINUX=0" ]
  }

  include_dirs = [
    "${tint_root_dir}/",
    "${tint_root_dir}/include/",
  ]
}

config("tint_config") {
  include_dirs = []
  if (tint_build_spv_reader || tint_build_spv_writer) {
    include_dirs += [ "${tint_spirv_tools_dir}/include/" ]
  }
}

source_set("dl") {
  # GN doesn't appear to need to depend on any dl libraries.
}

source_set("thread") {
  # GN doesn't appear to need to depend on any thread libraries.
}

source_set("metal") {
  frameworks = [
    "CoreGraphics.framework",
    "Foundation.framework",
    "Metal.framework",
  ]
}

config("tint_unittests_config") {
  include_dirs = [
    "${tint_googletest_dir}/googlemock/include",
    "${tint_googletest_dir}/googletest/include",
  ]

  configs = [
    ":tint_common_config",
    ":tint_public_config",
  ]

  if (is_win && is_debug) {
    # TODO(crbug.com/tint/1749): both msvc and clang builds stack overflow on debug builds.
    # Increase the initial stack size to 4 MB (default is 1MB).
    ldflags = [ "/STACK:4194304" ]
  }
}

if (tint_build_unittests) {
  ###############################################################################
  # Gtest Gmock - Handle building inside and outside of Chromium.
  ###############################################################################
  # When building outside of Chromium we need to define our own targets for GTest
  # and GMock. However when compiling inside of Chromium we need to reuse the
  # existing targets, both because Chromium has a special harness for swarming
  # and because otherwise the "gn check" fails.

  if (build_with_chromium) {
    # When we are in Chromium we reuse its targets, and also add some deps that
    # are needed to launch the test in swarming mode.
    group("gmock_and_gtest") {
      testonly = true
      public_deps = [
        "//base",
        "//base/test:test_support",
        "//testing/gmock",
        "//testing/gtest",
        "//third_party/googletest:gmock",
      ]
    }
  } else {
    # When we aren't in Chromium we define out own targets based on the location
    # of the googletest repo.
    config("gtest_config") {
      include_dirs = [
        "${tint_googletest_dir}/googletest",
        "${tint_googletest_dir}/googletest/include",
      ]
    }
    static_library("gtest") {
      testonly = true
      sources = [ "${tint_googletest_dir}/googletest/src/gtest-all.cc" ]
      public_configs = [ ":gtest_config" ]
    }

    config("gmock_config") {
      include_dirs = [
        "${tint_googletest_dir}/googlemock",
        "${tint_googletest_dir}/googlemock/include",
        "${tint_googletest_dir}/googletest/include",
      ]
    }

    static_library("gmock") {
      testonly = true
      sources = [ "${tint_googletest_dir}/googlemock/src/gmock-all.cc" ]
      public_configs = [ ":gmock_config" ]
    }

    group("gmock_and_gtest") {
      testonly = true
      public_deps = [
        ":gmock",
        ":gtest",
      ]
    }
  }
}

if (tint_build_benchmarks) {
  group("google_benchmark") {
    testonly = true
    public_deps = [ "//third_party/google_benchmark" ]
  }
}

group("abseil") {
  # When building within Chromium or ANGLE we need to include "//third_party/abseil-cpp:absl" while
  # it's beneficial to be more specific with standalone Dawn, especially when it comes to
  # including it as a dependency in other projects (such as Skia).
  if (build_with_chromium || build_with_angle) {
    public_deps = [ "$dawn_abseil_dir:absl" ]
  } else {
    public_deps = [ "${dawn_root}/third_party/gn/abseil-cpp:strings" ]
  }
}

source_set("winsock") {
  libs = [ "ws2_32.lib" ]
}

config("dxc-include-config") {
  include_dirs = [ "${dawn_dxc_dir}/include" ]
}
source_set("dxc-include") {
  public_configs = [ ":dxc-include-config" ]
}

###############################################################################
# Fuzzers
###############################################################################
if (tint_has_fuzzers) {
  action("tint_generate_wgsl_corpus") {
    script = "${tint_src_dir}/cmd/fuzz/wgsl/generate_wgsl_corpus.py"
    sources = [ "${script}" ]
    args = [
      "--stamp=" + rebase_path(fuzzer_corpus_wgsl_stamp, root_build_dir),
      rebase_path("${tint_root_dir}/test", root_build_dir),
      rebase_path(fuzzer_corpus_wgsl_dir, root_build_dir),
    ]
    outputs = [ fuzzer_corpus_wgsl_stamp ]
  }

  if (tint_build_ir_fuzzer) {
    if (tint_build_cmds && tint_build_wgsl_reader && tint_build_ir_binary) {
      action("tint_generate_ir_corpus") {
        script = "${tint_src_dir}/cmd/fuzz/wgsl/generate_ir_corpus.py"
        sources = [ "${script}" ]
        deps = [ "${tint_src_dir}/cmd/tint" ]
        args = [
          "--stamp=" + rebase_path(fuzzer_corpus_ir_stamp, root_build_dir),
          rebase_path("${root_build_dir}/tint", root_build_dir),
          rebase_path("${tint_root_dir}/test", root_build_dir),
          rebase_path(fuzzer_corpus_ir_dir, root_build_dir),
        ]
        outputs = [ fuzzer_corpus_ir_stamp ]
      }
    }
  }
}

###############################################################################
# Groups
###############################################################################
group("libs") {
  deps = [ "${tint_src_dir}/api" ]
}

group("cmds") {
  deps = []
  if (tint_build_cmds) {
    deps += [
      "${tint_src_dir}/cmd/info",
      "${tint_src_dir}/cmd/remote_compile",
      "${tint_src_dir}/cmd/tint",
    ]
  }
  if (tint_build_tintd) {
    deps += [ "${tint_src_dir}/cmd/tintd" ]
  }
}

group("fuzzers") {
  testonly = true
  deps = []
  if (tint_has_fuzzers) {
    deps += [ "${tint_src_dir}/cmd/fuzz/wgsl" ]
  }

  if (tint_build_ir_fuzzer && (!is_asan || build_with_chromium)) {
    deps += [ "${tint_src_dir}/cmd/fuzz/ir" ]
  }
}

group("tests") {
  testonly = true
  deps = []
  if (tint_build_unittests) {
    deps += [ "${tint_src_dir}/cmd/test:test_cmd" ]
  }
}

group("benchmarks") {
  testonly = true
  deps = []
  if (tint_build_benchmarks) {
    deps += [ "${tint_src_dir}/cmd/bench:bench_cmd" ]
  }
}

###############################################################################
# Aliases
###############################################################################
group("tint_unittests") {
  testonly = true
  public_deps = [ ":tests" ]
}
