# 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}",
  ]
}

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_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("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 build_with_chromium=true 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) {
    public_deps = [ "$dawn_abseil_dir:absl" ]
  } else {
    public_deps = [ "${dawn_abseil_dir}/absl/strings:strings" ]
  }
}

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

###############################################################################
# Fuzzers
###############################################################################
if (tint_has_fuzzers) {
  action("tint_generate_wgsl_corpus") {
    script = "${tint_src_dir}/cmd/fuzz/wgsl/generate_wgsl_corpus.py"
    sources = [ "${tint_src_dir}/cmd/fuzz/wgsl/generate_wgsl_corpus.py" ]
    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 ]
  }
}

###############################################################################
# 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",
      "${tint_src_dir}/fuzzers",
    ]
  }
}

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" ]
}
