1# Copyright 2021 The ANGLE Project Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("../../../gni/angle.gni")
6
7angle_source_set("angle_spirv_headers") {
8  sources = [ "spirv_types.h" ]
9
10  deps = [ "$angle_root:angle_common" ]
11}
12
13config("angle_spirv_config") {
14  if (angle_enable_direct_spirv_gen) {
15    defines = [ "ANGLE_ENABLE_DIRECT_SPIRV_GENERATION" ]
16  }
17}
18
19angle_source_set("angle_spirv_base") {
20  sources = [ "angle_spirv_utils.cpp" ]
21  deps = [
22    ":angle_spirv_headers",
23    "$angle_root:angle_common",
24    "${angle_spirv_headers_dir}:spv_headers",
25    "${angle_spirv_tools_dir}:spvtools_headers",
26  ]
27  public_configs = [ ":angle_spirv_config" ]
28
29  if (angle_debug_layers_enabled) {
30    deps += [ "$angle_spirv_tools_dir:spvtools_val" ]
31  }
32}
33
34angle_source_set("angle_spirv_builder") {
35  sources = [
36    "spirv_instruction_builder_autogen.cpp",
37    "spirv_instruction_builder_autogen.h",
38  ]
39  deps = [
40    ":angle_spirv_base",
41    ":angle_spirv_headers",
42    "$angle_root:angle_common",
43    "${angle_spirv_headers_dir}:spv_headers",
44  ]
45  public_configs = [ ":angle_spirv_config" ]
46}
47
48angle_source_set("angle_spirv_parser") {
49  sources = [
50    "spirv_instruction_parser_autogen.cpp",
51    "spirv_instruction_parser_autogen.h",
52  ]
53  deps = [
54    ":angle_spirv_base",
55    ":angle_spirv_headers",
56    "$angle_root:angle_common",
57    "${angle_spirv_headers_dir}:spv_headers",
58  ]
59  public_configs = [ ":angle_spirv_config" ]
60}
61