# Copyright 2021 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("../../../gni/angle.gni")

angle_source_set("angle_spirv_headers") {
  sources = [ "spirv_types.h" ]

  deps = [ "$angle_root:angle_common" ]
}

angle_source_set("angle_spirv_base") {
  sources = [ "angle_spirv_utils.cpp" ]
  deps = [
    ":angle_spirv_headers",
    "$angle_root:angle_common",
    "${angle_spirv_headers_dir}:spv_headers",
    "${angle_spirv_tools_dir}:spvtools_headers",
  ]

  if (dcheck_always_on || is_debug) {
    deps += [ "$angle_spirv_tools_dir:spvtools_val" ]
  }
}

angle_source_set("angle_spirv_builder") {
  sources = [
    "spirv_instruction_builder_autogen.cpp",
    "spirv_instruction_builder_autogen.h",
  ]
  deps = [
    ":angle_spirv_base",
    ":angle_spirv_headers",
    "$angle_root:angle_common",
    "${angle_spirv_headers_dir}:spv_headers",
  ]
}

angle_source_set("angle_spirv_parser") {
  sources = [
    "spirv_instruction_parser_autogen.cpp",
    "spirv_instruction_parser_autogen.h",
  ]
  deps = [
    ":angle_spirv_base",
    ":angle_spirv_headers",
    "$angle_root:angle_common",
    "${angle_spirv_headers_dir}:spv_headers",
  ]
}
