# Copyright 2018 The Dawn 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.

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

group("fuzzers") {
  testonly = true
  deps = [
    "src/dawn/fuzzers",
    "src/tint/fuzzers",
  ]
}

group("all") {
  testonly = true
  deps = [
    ":fuzzers",
    "src/dawn/native:webgpu_dawn",
    "src/dawn/tests",
    "src/tint/api",
  ]
  if (tint_build_unittests) {
    deps += [ "src/tint/cmd/test:test_cmd" ]
  }
  if (tint_build_benchmarks) {
    deps += [ "src/tint/cmd/bench:bench_cmd" ]
  }
  if (dawn_standalone) {
    deps += [
      "src/dawn/samples",
      "src/tint/cmd/remote_compile",
      "src/tint/cmd/tint",
    ]
  }
}

# This target is built when no specific target is specified on the command line.
group("default") {
  testonly = true
  deps = [ ":all" ]
}
