Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 1 | # Copyright 2018 Google Inc. All rights reserved. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 15 | import("//build_overrides/build.gni") |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 16 | import("//build_overrides/spirv_tools.gni") |
David Turner | a6bfc26 | 2019-07-03 22:26:06 +0200 | [diff] [blame] | 17 | if (build_with_chromium) { |
| 18 | import("//testing/test.gni") |
| 19 | } |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 20 | |
Corentin Wallez | 2d9a325 | 2018-08-02 18:48:03 +0200 | [diff] [blame] | 21 | spirv_headers = spirv_tools_spirv_headers_dir |
Shahbaz Youssefi | ae6a1e1 | 2021-04-12 13:17:44 -0400 | [diff] [blame] | 22 | spirv_is_winuwp = is_win && target_os == "winuwp" |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 23 | |
| 24 | template("spvtools_core_tables") { |
| 25 | assert(defined(invoker.version), "Need version in $target_name generation.") |
| 26 | |
| 27 | action("spvtools_core_tables_" + target_name) { |
| 28 | script = "utils/generate_grammar_tables.py" |
| 29 | |
| 30 | version = invoker.version |
| 31 | |
| 32 | core_json_file = |
| 33 | "${spirv_headers}/include/spirv/$version/spirv.core.grammar.json" |
| 34 | core_insts_file = "${target_gen_dir}/core.insts-$version.inc" |
| 35 | operand_kinds_file = "${target_gen_dir}/operand.kinds-$version.inc" |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 36 | debuginfo_insts_file = |
| 37 | "${spirv_headers}/include/spirv/unified1/extinst.debuginfo.grammar.json" |
alan-baker | 5030045 | 2020-07-30 12:08:53 -0400 | [diff] [blame] | 38 | cldebuginfo100_insts_file = "${spirv_headers}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json" |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 39 | |
| 40 | sources = [ |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 41 | cldebuginfo100_insts_file, |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 42 | core_json_file, |
Geoff Lang | c316fb1 | 2020-02-21 17:23:42 -0500 | [diff] [blame] | 43 | debuginfo_insts_file, |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 44 | ] |
| 45 | outputs = [ |
| 46 | core_insts_file, |
| 47 | operand_kinds_file, |
| 48 | ] |
| 49 | args = [ |
| 50 | "--spirv-core-grammar", |
| 51 | rebase_path(core_json_file, root_build_dir), |
| 52 | "--core-insts-output", |
| 53 | rebase_path(core_insts_file, root_build_dir), |
| 54 | "--extinst-debuginfo-grammar", |
David Neto | 64f36ea | 2019-12-19 17:16:26 -0500 | [diff] [blame] | 55 | rebase_path(debuginfo_insts_file, root_build_dir), |
| 56 | "--extinst-cldebuginfo100-grammar", |
| 57 | rebase_path(cldebuginfo100_insts_file, root_build_dir), |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 58 | "--operand-kinds-output", |
| 59 | rebase_path(operand_kinds_file, root_build_dir), |
| 60 | ] |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | template("spvtools_core_enums") { |
| 65 | assert(defined(invoker.version), "Need version in $target_name generation.") |
| 66 | |
| 67 | action("spvtools_core_enums_" + target_name) { |
| 68 | script = "utils/generate_grammar_tables.py" |
| 69 | |
| 70 | version = invoker.version |
| 71 | |
| 72 | core_json_file = |
| 73 | "${spirv_headers}/include/spirv/$version/spirv.core.grammar.json" |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 74 | debuginfo_insts_file = |
| 75 | "${spirv_headers}/include/spirv/unified1/extinst.debuginfo.grammar.json" |
alan-baker | 5030045 | 2020-07-30 12:08:53 -0400 | [diff] [blame] | 76 | cldebuginfo100_insts_file = "${spirv_headers}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json" |
David Neto | fb2e819 | 2020-01-08 17:27:38 -0500 | [diff] [blame] | 77 | |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 78 | extension_enum_file = "${target_gen_dir}/extension_enum.inc" |
| 79 | extension_map_file = "${target_gen_dir}/enum_string_mapping.inc" |
| 80 | |
| 81 | args = [ |
| 82 | "--spirv-core-grammar", |
| 83 | rebase_path(core_json_file, root_build_dir), |
| 84 | "--extinst-debuginfo-grammar", |
David Neto | 64f36ea | 2019-12-19 17:16:26 -0500 | [diff] [blame] | 85 | rebase_path(debuginfo_insts_file, root_build_dir), |
| 86 | "--extinst-cldebuginfo100-grammar", |
| 87 | rebase_path(cldebuginfo100_insts_file, root_build_dir), |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 88 | "--extension-enum-output", |
| 89 | rebase_path(extension_enum_file, root_build_dir), |
| 90 | "--enum-string-mapping-output", |
| 91 | rebase_path(extension_map_file, root_build_dir), |
| 92 | ] |
| 93 | inputs = [ |
| 94 | core_json_file, |
David Neto | fb2e819 | 2020-01-08 17:27:38 -0500 | [diff] [blame] | 95 | debuginfo_insts_file, |
| 96 | cldebuginfo100_insts_file, |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 97 | ] |
| 98 | outputs = [ |
| 99 | extension_enum_file, |
| 100 | extension_map_file, |
| 101 | ] |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | template("spvtools_glsl_tables") { |
| 106 | assert(defined(invoker.version), "Need version in $target_name generation.") |
| 107 | |
| 108 | action("spvtools_glsl_tables_" + target_name) { |
| 109 | script = "utils/generate_grammar_tables.py" |
| 110 | |
| 111 | version = invoker.version |
| 112 | |
| 113 | core_json_file = |
| 114 | "${spirv_headers}/include/spirv/$version/spirv.core.grammar.json" |
| 115 | glsl_json_file = "${spirv_headers}/include/spirv/${version}/extinst.glsl.std.450.grammar.json" |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 116 | debuginfo_insts_file = |
| 117 | "${spirv_headers}/include/spirv/unified1/extinst.debuginfo.grammar.json" |
alan-baker | 5030045 | 2020-07-30 12:08:53 -0400 | [diff] [blame] | 118 | cldebuginfo100_insts_file = "${spirv_headers}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json" |
David Neto | fb2e819 | 2020-01-08 17:27:38 -0500 | [diff] [blame] | 119 | |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 120 | glsl_insts_file = "${target_gen_dir}/glsl.std.450.insts.inc" |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 121 | |
| 122 | args = [ |
| 123 | "--spirv-core-grammar", |
| 124 | rebase_path(core_json_file, root_build_dir), |
David Neto | fb2e819 | 2020-01-08 17:27:38 -0500 | [diff] [blame] | 125 | "--extinst-debuginfo-grammar", |
| 126 | rebase_path(debuginfo_insts_file, root_build_dir), |
| 127 | "--extinst-cldebuginfo100-grammar", |
| 128 | rebase_path(cldebuginfo100_insts_file, root_build_dir), |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 129 | "--extinst-glsl-grammar", |
| 130 | rebase_path(glsl_json_file, root_build_dir), |
| 131 | "--glsl-insts-output", |
| 132 | rebase_path(glsl_insts_file, root_build_dir), |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 133 | ] |
| 134 | inputs = [ |
| 135 | core_json_file, |
| 136 | glsl_json_file, |
David Neto | fb2e819 | 2020-01-08 17:27:38 -0500 | [diff] [blame] | 137 | debuginfo_insts_file, |
| 138 | cldebuginfo100_insts_file, |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 139 | ] |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 140 | outputs = [ glsl_insts_file ] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 141 | } |
| 142 | } |
| 143 | |
| 144 | template("spvtools_opencl_tables") { |
| 145 | assert(defined(invoker.version), "Need version in $target_name generation.") |
| 146 | |
| 147 | action("spvtools_opencl_tables_" + target_name) { |
| 148 | script = "utils/generate_grammar_tables.py" |
| 149 | |
| 150 | version = invoker.version |
| 151 | |
| 152 | core_json_file = |
| 153 | "${spirv_headers}/include/spirv/$version/spirv.core.grammar.json" |
David Neto | fb2e819 | 2020-01-08 17:27:38 -0500 | [diff] [blame] | 154 | opencl_json_file = "${spirv_headers}/include/spirv/${version}/extinst.opencl.std.100.grammar.json" |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 155 | debuginfo_insts_file = |
| 156 | "${spirv_headers}/include/spirv/unified1/extinst.debuginfo.grammar.json" |
alan-baker | 5030045 | 2020-07-30 12:08:53 -0400 | [diff] [blame] | 157 | cldebuginfo100_insts_file = "${spirv_headers}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json" |
David Neto | fb2e819 | 2020-01-08 17:27:38 -0500 | [diff] [blame] | 158 | |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 159 | opencl_insts_file = "${target_gen_dir}/opencl.std.insts.inc" |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 160 | |
| 161 | args = [ |
| 162 | "--spirv-core-grammar", |
| 163 | rebase_path(core_json_file, root_build_dir), |
David Neto | fb2e819 | 2020-01-08 17:27:38 -0500 | [diff] [blame] | 164 | "--extinst-debuginfo-grammar", |
| 165 | rebase_path(debuginfo_insts_file, root_build_dir), |
| 166 | "--extinst-cldebuginfo100-grammar", |
| 167 | rebase_path(cldebuginfo100_insts_file, root_build_dir), |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 168 | "--extinst-opencl-grammar", |
David Neto | fb2e819 | 2020-01-08 17:27:38 -0500 | [diff] [blame] | 169 | rebase_path(opencl_json_file, root_build_dir), |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 170 | "--opencl-insts-output", |
| 171 | rebase_path(opencl_insts_file, root_build_dir), |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 172 | ] |
| 173 | inputs = [ |
| 174 | core_json_file, |
David Neto | fb2e819 | 2020-01-08 17:27:38 -0500 | [diff] [blame] | 175 | opencl_json_file, |
| 176 | debuginfo_insts_file, |
| 177 | cldebuginfo100_insts_file, |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 178 | ] |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 179 | outputs = [ opencl_insts_file ] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 180 | } |
| 181 | } |
| 182 | |
| 183 | template("spvtools_language_header") { |
| 184 | assert(defined(invoker.name), "Need name in $target_name generation.") |
| 185 | |
| 186 | action("spvtools_language_header_" + target_name) { |
| 187 | script = "utils/generate_language_headers.py" |
| 188 | |
| 189 | name = invoker.name |
Geoff Lang | fb6e3e4 | 2020-02-25 00:46:52 -0500 | [diff] [blame] | 190 | extinst_output_path = "${target_gen_dir}/${name}.h" |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 191 | |
| 192 | args = [ |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 193 | "--extinst-grammar", |
David Neto | 64f36ea | 2019-12-19 17:16:26 -0500 | [diff] [blame] | 194 | rebase_path(invoker.grammar_file, root_build_dir), |
Geoff Lang | fb6e3e4 | 2020-02-25 00:46:52 -0500 | [diff] [blame] | 195 | "--extinst-output-path", |
| 196 | rebase_path(extinst_output_path, root_build_dir), |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 197 | ] |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 198 | inputs = [ invoker.grammar_file ] |
| 199 | outputs = [ "${extinst_output_path}" ] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 200 | } |
| 201 | } |
| 202 | |
| 203 | template("spvtools_vendor_table") { |
| 204 | assert(defined(invoker.name), "Need name in $target_name generation.") |
| 205 | |
| 206 | action("spvtools_vendor_tables_" + target_name) { |
| 207 | script = "utils/generate_grammar_tables.py" |
| 208 | |
| 209 | name = invoker.name |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 210 | extinst_vendor_grammar = |
| 211 | "${spirv_headers}/include/spirv/unified1/extinst.${name}.grammar.json" |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 212 | extinst_file = "${target_gen_dir}/${name}.insts.inc" |
| 213 | |
| 214 | args = [ |
| 215 | "--extinst-vendor-grammar", |
| 216 | rebase_path(extinst_vendor_grammar, root_build_dir), |
| 217 | "--vendor-insts-output", |
| 218 | rebase_path(extinst_file, root_build_dir), |
David Neto | 64f36ea | 2019-12-19 17:16:26 -0500 | [diff] [blame] | 219 | "--vendor-operand-kind-prefix", |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 220 | invoker.operand_kind_prefix, |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 221 | ] |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 222 | inputs = [ extinst_vendor_grammar ] |
| 223 | outputs = [ extinst_file ] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 224 | } |
| 225 | } |
| 226 | |
| 227 | action("spvtools_generators_inc") { |
| 228 | script = "utils/generate_registry_tables.py" |
| 229 | |
| 230 | # TODO(dsinclair): Make work for chrome |
| 231 | xml_file = "${spirv_headers}/include/spirv/spir-v.xml" |
| 232 | inc_file = "${target_gen_dir}/generators.inc" |
| 233 | |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 234 | sources = [ xml_file ] |
| 235 | outputs = [ inc_file ] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 236 | args = [ |
| 237 | "--xml", |
| 238 | rebase_path(xml_file, root_build_dir), |
| 239 | "--generator", |
| 240 | rebase_path(inc_file, root_build_dir), |
| 241 | ] |
| 242 | } |
| 243 | |
dan sinclair | 1bdade7 | 2018-08-15 15:26:28 -0400 | [diff] [blame] | 244 | action("spvtools_build_version") { |
| 245 | script = "utils/update_build_version.py" |
| 246 | |
| 247 | src_dir = "." |
| 248 | inc_file = "${target_gen_dir}/build-version.inc" |
| 249 | |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 250 | outputs = [ inc_file ] |
dan sinclair | 1bdade7 | 2018-08-15 15:26:28 -0400 | [diff] [blame] | 251 | args = [ |
| 252 | rebase_path(src_dir, root_build_dir), |
| 253 | rebase_path(inc_file, root_build_dir), |
| 254 | ] |
| 255 | } |
| 256 | |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 257 | spvtools_core_tables("unified1") { |
| 258 | version = "unified1" |
| 259 | } |
| 260 | spvtools_core_enums("unified1") { |
| 261 | version = "unified1" |
| 262 | } |
| 263 | spvtools_glsl_tables("glsl1-0") { |
| 264 | version = "1.0" |
| 265 | } |
| 266 | spvtools_opencl_tables("opencl1-0") { |
| 267 | version = "1.0" |
| 268 | } |
David Neto | 64f36ea | 2019-12-19 17:16:26 -0500 | [diff] [blame] | 269 | spvtools_language_header("debuginfo") { |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 270 | name = "DebugInfo" |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 271 | grammar_file = |
| 272 | "${spirv_headers}/include/spirv/unified1/extinst.debuginfo.grammar.json" |
David Neto | 64f36ea | 2019-12-19 17:16:26 -0500 | [diff] [blame] | 273 | } |
| 274 | spvtools_language_header("cldebuginfo100") { |
| 275 | name = "OpenCLDebugInfo100" |
alan-baker | 5030045 | 2020-07-30 12:08:53 -0400 | [diff] [blame] | 276 | grammar_file = "${spirv_headers}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json" |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 277 | } |
| 278 | |
| 279 | spvtools_vendor_tables = [ |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 280 | [ |
| 281 | "spv-amd-shader-explicit-vertex-parameter", |
| 282 | "...nil...", |
| 283 | ], |
| 284 | [ |
| 285 | "spv-amd-shader-trinary-minmax", |
| 286 | "...nil...", |
| 287 | ], |
| 288 | [ |
| 289 | "spv-amd-gcn-shader", |
| 290 | "...nil...", |
| 291 | ], |
| 292 | [ |
| 293 | "spv-amd-shader-ballot", |
| 294 | "...nil...", |
| 295 | ], |
| 296 | [ |
| 297 | "debuginfo", |
| 298 | "...nil...", |
| 299 | ], |
| 300 | [ |
| 301 | "opencl.debuginfo.100", |
| 302 | "CLDEBUG100_", |
| 303 | ], |
| 304 | [ |
| 305 | "nonsemantic.clspvreflection", |
| 306 | "...nil...", |
| 307 | ], |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 308 | ] |
| 309 | |
David Neto | 64f36ea | 2019-12-19 17:16:26 -0500 | [diff] [blame] | 310 | foreach(table_def, spvtools_vendor_tables) { |
David Neto | fb2e819 | 2020-01-08 17:27:38 -0500 | [diff] [blame] | 311 | spvtools_vendor_table(table_def[0]) { |
David Neto | 64f36ea | 2019-12-19 17:16:26 -0500 | [diff] [blame] | 312 | name = table_def[0] |
| 313 | operand_kind_prefix = table_def[1] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 314 | } |
| 315 | } |
| 316 | |
Corentin Wallez | 21bcb9d | 2018-09-06 10:50:27 -0400 | [diff] [blame] | 317 | config("spvtools_public_config") { |
| 318 | include_dirs = [ "include" ] |
| 319 | } |
| 320 | |
| 321 | config("spvtools_internal_config") { |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 322 | include_dirs = [ |
| 323 | ".", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 324 | "$target_gen_dir", |
| 325 | "${spirv_headers}/include", |
| 326 | ] |
| 327 | |
Corentin Wallez | 21bcb9d | 2018-09-06 10:50:27 -0400 | [diff] [blame] | 328 | configs = [ ":spvtools_public_config" ] |
| 329 | |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 330 | cflags = [] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 331 | if (is_clang) { |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 332 | cflags += [ |
David Turner | 36c1c0e | 2019-09-17 21:57:15 +0200 | [diff] [blame] | 333 | "-Wno-implicit-fallthrough", |
| 334 | "-Wno-newline-eof", |
| 335 | ] |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 336 | } else if (!is_win) { |
| 337 | # Work around a false-positive on a Skia GCC 10 builder. |
Corentin Wallez | 5d8c403 | 2021-03-11 10:08:33 +0000 | [diff] [blame] | 338 | cflags += [ "-Wno-format-truncation" ] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 339 | } |
| 340 | } |
| 341 | |
Corentin Wallez | 21bcb9d | 2018-09-06 10:50:27 -0400 | [diff] [blame] | 342 | source_set("spvtools_headers") { |
| 343 | sources = [ |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 344 | "include/spirv-tools/instrument.hpp", |
Corentin Wallez | 21bcb9d | 2018-09-06 10:50:27 -0400 | [diff] [blame] | 345 | "include/spirv-tools/libspirv.h", |
| 346 | "include/spirv-tools/libspirv.hpp", |
| 347 | "include/spirv-tools/linker.hpp", |
| 348 | "include/spirv-tools/optimizer.hpp", |
| 349 | ] |
| 350 | |
| 351 | public_configs = [ ":spvtools_public_config" ] |
| 352 | } |
| 353 | |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 354 | static_library("spvtools") { |
| 355 | deps = [ |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 356 | ":spvtools_core_tables_unified1", |
| 357 | ":spvtools_generators_inc", |
| 358 | ":spvtools_glsl_tables_glsl1-0", |
David Neto | 64f36ea | 2019-12-19 17:16:26 -0500 | [diff] [blame] | 359 | ":spvtools_language_header_cldebuginfo100", |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 360 | ":spvtools_language_header_debuginfo", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 361 | ":spvtools_opencl_tables_opencl1-0", |
| 362 | ] |
David Neto | 64f36ea | 2019-12-19 17:16:26 -0500 | [diff] [blame] | 363 | foreach(table_def, spvtools_vendor_tables) { |
| 364 | target_name = table_def[0] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 365 | deps += [ ":spvtools_vendor_tables_$target_name" ] |
| 366 | } |
| 367 | |
| 368 | sources = [ |
| 369 | "source/assembly_grammar.cpp", |
| 370 | "source/assembly_grammar.h", |
| 371 | "source/binary.cpp", |
| 372 | "source/binary.h", |
Jamie Madill | e0d5544 | 2019-11-04 21:01:57 -0500 | [diff] [blame] | 373 | "source/cfa.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 374 | "source/diagnostic.cpp", |
| 375 | "source/diagnostic.h", |
| 376 | "source/disassemble.cpp", |
Jamie Madill | e0d5544 | 2019-11-04 21:01:57 -0500 | [diff] [blame] | 377 | "source/disassemble.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 378 | "source/enum_set.h", |
| 379 | "source/enum_string_mapping.cpp", |
Jamie Madill | e0d5544 | 2019-11-04 21:01:57 -0500 | [diff] [blame] | 380 | "source/enum_string_mapping.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 381 | "source/ext_inst.cpp", |
| 382 | "source/ext_inst.h", |
| 383 | "source/extensions.cpp", |
| 384 | "source/extensions.h", |
| 385 | "source/instruction.h", |
Jamie Madill | e0d5544 | 2019-11-04 21:01:57 -0500 | [diff] [blame] | 386 | "source/latest_version_glsl_std_450_header.h", |
| 387 | "source/latest_version_opencl_std_header.h", |
| 388 | "source/latest_version_spirv_header.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 389 | "source/libspirv.cpp", |
| 390 | "source/macro.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 391 | "source/name_mapper.cpp", |
| 392 | "source/name_mapper.h", |
| 393 | "source/opcode.cpp", |
| 394 | "source/opcode.h", |
| 395 | "source/operand.cpp", |
| 396 | "source/operand.h", |
| 397 | "source/parsed_operand.cpp", |
| 398 | "source/parsed_operand.h", |
| 399 | "source/print.cpp", |
| 400 | "source/print.h", |
| 401 | "source/spirv_constant.h", |
| 402 | "source/spirv_definition.h", |
| 403 | "source/spirv_endian.cpp", |
| 404 | "source/spirv_endian.h", |
dan sinclair | 324be76 | 2018-09-11 09:34:42 -0400 | [diff] [blame] | 405 | "source/spirv_optimizer_options.cpp", |
| 406 | "source/spirv_optimizer_options.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 407 | "source/spirv_target_env.cpp", |
| 408 | "source/spirv_target_env.h", |
| 409 | "source/spirv_validator_options.cpp", |
| 410 | "source/spirv_validator_options.h", |
| 411 | "source/table.cpp", |
| 412 | "source/table.h", |
| 413 | "source/text.cpp", |
| 414 | "source/text.h", |
| 415 | "source/text_handler.cpp", |
| 416 | "source/text_handler.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 417 | "source/util/bit_vector.cpp", |
| 418 | "source/util/bit_vector.h", |
| 419 | "source/util/bitutils.h", |
| 420 | "source/util/hex_float.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 421 | "source/util/ilist.h", |
| 422 | "source/util/ilist_node.h", |
dan sinclair | 1553025 | 2018-08-14 12:44:54 -0400 | [diff] [blame] | 423 | "source/util/make_unique.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 424 | "source/util/parse_number.cpp", |
| 425 | "source/util/parse_number.h", |
| 426 | "source/util/small_vector.h", |
| 427 | "source/util/string_utils.cpp", |
| 428 | "source/util/string_utils.h", |
| 429 | "source/util/timer.cpp", |
| 430 | "source/util/timer.h", |
| 431 | ] |
| 432 | |
Corentin Wallez | 21bcb9d | 2018-09-06 10:50:27 -0400 | [diff] [blame] | 433 | public_deps = [ |
Takuto Ikuta | 0187c19 | 2019-02-14 00:24:06 +0900 | [diff] [blame] | 434 | ":spvtools_core_enums_unified1", |
Corentin Wallez | 21bcb9d | 2018-09-06 10:50:27 -0400 | [diff] [blame] | 435 | ":spvtools_headers", |
Shahbaz Youssefi | b97057e | 2020-01-23 13:40:13 -0500 | [diff] [blame] | 436 | "${spirv_headers}:spv_headers", |
Corentin Wallez | 21bcb9d | 2018-09-06 10:50:27 -0400 | [diff] [blame] | 437 | ] |
| 438 | |
David Turner | a6bfc26 | 2019-07-03 22:26:06 +0200 | [diff] [blame] | 439 | if (build_with_chromium) { |
| 440 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 441 | configs += [ "//build/config/compiler:no_chromium_code" ] |
| 442 | } |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 443 | configs += [ ":spvtools_internal_config" ] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 444 | } |
| 445 | |
| 446 | static_library("spvtools_val") { |
| 447 | sources = [ |
| 448 | "source/val/basic_block.cpp", |
Jamie Madill | e0d5544 | 2019-11-04 21:01:57 -0500 | [diff] [blame] | 449 | "source/val/basic_block.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 450 | "source/val/construct.cpp", |
Jamie Madill | e0d5544 | 2019-11-04 21:01:57 -0500 | [diff] [blame] | 451 | "source/val/construct.h", |
| 452 | "source/val/decoration.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 453 | "source/val/function.cpp", |
Jamie Madill | e0d5544 | 2019-11-04 21:01:57 -0500 | [diff] [blame] | 454 | "source/val/function.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 455 | "source/val/instruction.cpp", |
| 456 | "source/val/validate.cpp", |
| 457 | "source/val/validate.h", |
| 458 | "source/val/validate_adjacency.cpp", |
Alan Baker | 7d4b046 | 2018-08-08 14:21:27 -0400 | [diff] [blame] | 459 | "source/val/validate_annotation.cpp", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 460 | "source/val/validate_arithmetics.cpp", |
| 461 | "source/val/validate_atomics.cpp", |
| 462 | "source/val/validate_barriers.cpp", |
| 463 | "source/val/validate_bitwise.cpp", |
| 464 | "source/val/validate_builtins.cpp", |
| 465 | "source/val/validate_capability.cpp", |
| 466 | "source/val/validate_cfg.cpp", |
| 467 | "source/val/validate_composites.cpp", |
Alan Baker | c5b3806 | 2018-08-17 11:20:55 -0400 | [diff] [blame] | 468 | "source/val/validate_constants.cpp", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 469 | "source/val/validate_conversion.cpp", |
Alan Baker | ca7278c | 2018-08-08 13:47:09 -0400 | [diff] [blame] | 470 | "source/val/validate_debug.cpp", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 471 | "source/val/validate_decorations.cpp", |
| 472 | "source/val/validate_derivatives.cpp", |
Alan Baker | e7fdcdb | 2018-08-10 09:53:17 -0400 | [diff] [blame] | 473 | "source/val/validate_execution_limitations.cpp", |
dan sinclair | 703305b | 2018-11-28 09:17:13 -0500 | [diff] [blame] | 474 | "source/val/validate_extensions.cpp", |
Alan Baker | e7fdcdb | 2018-08-10 09:53:17 -0400 | [diff] [blame] | 475 | "source/val/validate_function.cpp", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 476 | "source/val/validate_id.cpp", |
| 477 | "source/val/validate_image.cpp", |
| 478 | "source/val/validate_instruction.cpp", |
| 479 | "source/val/validate_interfaces.cpp", |
| 480 | "source/val/validate_layout.cpp", |
| 481 | "source/val/validate_literals.cpp", |
| 482 | "source/val/validate_logicals.cpp", |
Alan Baker | d49bedc | 2018-08-01 14:44:56 -0400 | [diff] [blame] | 483 | "source/val/validate_memory.cpp", |
Ryan Harrison | cf37ab7 | 2018-12-06 14:38:15 -0500 | [diff] [blame] | 484 | "source/val/validate_memory_semantics.cpp", |
Jamie Madill | e0d5544 | 2019-11-04 21:01:57 -0500 | [diff] [blame] | 485 | "source/val/validate_memory_semantics.h", |
Jeff Bolz | 2c0111e | 2019-06-03 09:55:07 -0500 | [diff] [blame] | 486 | "source/val/validate_misc.cpp", |
Alan Baker | 714bf84 | 2018-08-08 14:49:59 -0400 | [diff] [blame] | 487 | "source/val/validate_mode_setting.cpp", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 488 | "source/val/validate_non_uniform.cpp", |
| 489 | "source/val/validate_primitives.cpp", |
Ryan Harrison | 8ce3dba | 2018-11-29 13:48:42 -0500 | [diff] [blame] | 490 | "source/val/validate_scopes.cpp", |
Jamie Madill | e0d5544 | 2019-11-04 21:01:57 -0500 | [diff] [blame] | 491 | "source/val/validate_scopes.h", |
alan-baker | 1a2de48 | 2019-07-11 13:05:14 -0400 | [diff] [blame] | 492 | "source/val/validate_small_type_uses.cpp", |
Alan Baker | f2a9900 | 2018-08-03 11:38:51 -0400 | [diff] [blame] | 493 | "source/val/validate_type.cpp", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 494 | "source/val/validation_state.cpp", |
Jamie Madill | e0d5544 | 2019-11-04 21:01:57 -0500 | [diff] [blame] | 495 | "source/val/validation_state.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 496 | ] |
| 497 | |
| 498 | deps = [ |
| 499 | ":spvtools", |
Shahbaz Youssefi | 1b34410 | 2020-01-24 17:14:16 -0500 | [diff] [blame] | 500 | ":spvtools_language_header_cldebuginfo100", |
| 501 | ":spvtools_language_header_debuginfo", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 502 | ] |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 503 | public_deps = [ ":spvtools_headers" ] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 504 | |
David Turner | a6bfc26 | 2019-07-03 22:26:06 +0200 | [diff] [blame] | 505 | if (build_with_chromium) { |
| 506 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 507 | configs += [ "//build/config/compiler:no_chromium_code" ] |
| 508 | } |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 509 | configs += [ ":spvtools_internal_config" ] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 510 | } |
| 511 | |
| 512 | static_library("spvtools_opt") { |
| 513 | sources = [ |
| 514 | "source/opt/aggressive_dead_code_elim_pass.cpp", |
| 515 | "source/opt/aggressive_dead_code_elim_pass.h", |
Steven Perron | 35d98be | 2019-08-29 12:48:17 -0400 | [diff] [blame] | 516 | "source/opt/amd_ext_to_khr.cpp", |
| 517 | "source/opt/amd_ext_to_khr.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 518 | "source/opt/basic_block.cpp", |
| 519 | "source/opt/basic_block.h", |
| 520 | "source/opt/block_merge_pass.cpp", |
| 521 | "source/opt/block_merge_pass.h", |
David Neto | cf78346 | 2019-01-28 18:42:35 -0800 | [diff] [blame] | 522 | "source/opt/block_merge_util.cpp", |
| 523 | "source/opt/block_merge_util.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 524 | "source/opt/build_module.cpp", |
| 525 | "source/opt/build_module.h", |
| 526 | "source/opt/ccp_pass.cpp", |
| 527 | "source/opt/ccp_pass.h", |
| 528 | "source/opt/cfg.cpp", |
| 529 | "source/opt/cfg.h", |
| 530 | "source/opt/cfg_cleanup_pass.cpp", |
| 531 | "source/opt/cfg_cleanup_pass.h", |
Steven Perron | dd4157d | 2019-01-17 15:56:36 -0500 | [diff] [blame] | 532 | "source/opt/code_sink.cpp", |
| 533 | "source/opt/code_sink.h", |
dan sinclair | de9496e | 2018-08-02 14:36:43 -0400 | [diff] [blame] | 534 | "source/opt/combine_access_chains.cpp", |
| 535 | "source/opt/combine_access_chains.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 536 | "source/opt/compact_ids_pass.cpp", |
| 537 | "source/opt/compact_ids_pass.h", |
| 538 | "source/opt/composite.cpp", |
| 539 | "source/opt/composite.h", |
| 540 | "source/opt/const_folding_rules.cpp", |
| 541 | "source/opt/const_folding_rules.h", |
| 542 | "source/opt/constants.cpp", |
| 543 | "source/opt/constants.h", |
greg-lunarg | d11725b | 2019-09-03 11:22:13 -0600 | [diff] [blame] | 544 | "source/opt/convert_to_half_pass.cpp", |
| 545 | "source/opt/convert_to_half_pass.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 546 | "source/opt/copy_prop_arrays.cpp", |
| 547 | "source/opt/copy_prop_arrays.h", |
| 548 | "source/opt/dead_branch_elim_pass.cpp", |
| 549 | "source/opt/dead_branch_elim_pass.h", |
| 550 | "source/opt/dead_insert_elim_pass.cpp", |
| 551 | "source/opt/dead_insert_elim_pass.h", |
| 552 | "source/opt/dead_variable_elimination.cpp", |
| 553 | "source/opt/dead_variable_elimination.h", |
Jaebaek Seo | 4226874 | 2020-04-27 15:18:55 -0400 | [diff] [blame] | 554 | "source/opt/debug_info_manager.cpp", |
| 555 | "source/opt/debug_info_manager.h", |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 556 | "source/opt/decoration_manager.cpp", |
| 557 | "source/opt/decoration_manager.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 558 | "source/opt/def_use_manager.cpp", |
| 559 | "source/opt/def_use_manager.h", |
Steven Perron | 4b64beb | 2019-08-08 10:53:19 -0400 | [diff] [blame] | 560 | "source/opt/desc_sroa.cpp", |
| 561 | "source/opt/desc_sroa.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 562 | "source/opt/dominator_analysis.cpp", |
| 563 | "source/opt/dominator_analysis.h", |
| 564 | "source/opt/dominator_tree.cpp", |
| 565 | "source/opt/dominator_tree.h", |
| 566 | "source/opt/eliminate_dead_constant_pass.cpp", |
| 567 | "source/opt/eliminate_dead_constant_pass.h", |
| 568 | "source/opt/eliminate_dead_functions_pass.cpp", |
| 569 | "source/opt/eliminate_dead_functions_pass.h", |
Alastair Donaldson | 34c5ac6 | 2019-02-08 16:20:29 +0000 | [diff] [blame] | 570 | "source/opt/eliminate_dead_functions_util.cpp", |
| 571 | "source/opt/eliminate_dead_functions_util.h", |
Steven Perron | 1b0047f | 2019-02-14 13:42:35 -0500 | [diff] [blame] | 572 | "source/opt/eliminate_dead_members_pass.cpp", |
| 573 | "source/opt/eliminate_dead_members_pass.h", |
Jaebaek Seo | f7da527 | 2020-10-30 18:03:56 -0400 | [diff] [blame] | 574 | "source/opt/empty_pass.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 575 | "source/opt/feature_manager.cpp", |
| 576 | "source/opt/feature_manager.h", |
Steven Perron | 3a0bc9e | 2019-04-05 13:12:08 -0400 | [diff] [blame] | 577 | "source/opt/fix_storage_class.cpp", |
| 578 | "source/opt/fix_storage_class.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 579 | "source/opt/flatten_decoration_pass.cpp", |
| 580 | "source/opt/flatten_decoration_pass.h", |
| 581 | "source/opt/fold.cpp", |
| 582 | "source/opt/fold.h", |
| 583 | "source/opt/fold_spec_constant_op_and_composite_pass.cpp", |
| 584 | "source/opt/fold_spec_constant_op_and_composite_pass.h", |
| 585 | "source/opt/folding_rules.cpp", |
| 586 | "source/opt/folding_rules.h", |
| 587 | "source/opt/freeze_spec_constant_value_pass.cpp", |
| 588 | "source/opt/freeze_spec_constant_value_pass.h", |
| 589 | "source/opt/function.cpp", |
| 590 | "source/opt/function.h", |
David Neto | 3159010 | 2019-07-30 19:52:46 -0400 | [diff] [blame] | 591 | "source/opt/graphics_robust_access_pass.cpp", |
| 592 | "source/opt/graphics_robust_access_pass.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 593 | "source/opt/if_conversion.cpp", |
| 594 | "source/opt/if_conversion.h", |
| 595 | "source/opt/inline_exhaustive_pass.cpp", |
| 596 | "source/opt/inline_exhaustive_pass.h", |
| 597 | "source/opt/inline_opaque_pass.cpp", |
| 598 | "source/opt/inline_opaque_pass.h", |
| 599 | "source/opt/inline_pass.cpp", |
| 600 | "source/opt/inline_pass.h", |
greg-lunarg | 1e9fc1a | 2018-11-08 11:54:54 -0700 | [diff] [blame] | 601 | "source/opt/inst_bindless_check_pass.cpp", |
| 602 | "source/opt/inst_bindless_check_pass.h", |
greg-lunarg | 0640725 | 2019-08-16 07:18:34 -0600 | [diff] [blame] | 603 | "source/opt/inst_buff_addr_check_pass.cpp", |
| 604 | "source/opt/inst_buff_addr_check_pass.h", |
greg-lunarg | 1fe9bcc | 2020-03-12 07:19:52 -0600 | [diff] [blame] | 605 | "source/opt/inst_debug_printf_pass.cpp", |
| 606 | "source/opt/inst_debug_printf_pass.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 607 | "source/opt/instruction.cpp", |
| 608 | "source/opt/instruction.h", |
| 609 | "source/opt/instruction_list.cpp", |
| 610 | "source/opt/instruction_list.h", |
greg-lunarg | 1e9fc1a | 2018-11-08 11:54:54 -0700 | [diff] [blame] | 611 | "source/opt/instrument_pass.cpp", |
| 612 | "source/opt/instrument_pass.h", |
Greg Fischer | 48007a5 | 2021-03-31 12:26:36 -0600 | [diff] [blame] | 613 | "source/opt/interp_fixup_pass.cpp", |
| 614 | "source/opt/interp_fixup_pass.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 615 | "source/opt/ir_builder.h", |
| 616 | "source/opt/ir_context.cpp", |
| 617 | "source/opt/ir_context.h", |
| 618 | "source/opt/ir_loader.cpp", |
| 619 | "source/opt/ir_loader.h", |
| 620 | "source/opt/iterator.h", |
| 621 | "source/opt/licm_pass.cpp", |
| 622 | "source/opt/licm_pass.h", |
| 623 | "source/opt/local_access_chain_convert_pass.cpp", |
| 624 | "source/opt/local_access_chain_convert_pass.h", |
| 625 | "source/opt/local_redundancy_elimination.cpp", |
| 626 | "source/opt/local_redundancy_elimination.h", |
| 627 | "source/opt/local_single_block_elim_pass.cpp", |
| 628 | "source/opt/local_single_block_elim_pass.h", |
| 629 | "source/opt/local_single_store_elim_pass.cpp", |
| 630 | "source/opt/local_single_store_elim_pass.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 631 | "source/opt/log.h", |
| 632 | "source/opt/loop_dependence.cpp", |
| 633 | "source/opt/loop_dependence.h", |
| 634 | "source/opt/loop_dependence_helpers.cpp", |
| 635 | "source/opt/loop_descriptor.cpp", |
| 636 | "source/opt/loop_descriptor.h", |
| 637 | "source/opt/loop_fission.cpp", |
| 638 | "source/opt/loop_fission.h", |
| 639 | "source/opt/loop_fusion.cpp", |
| 640 | "source/opt/loop_fusion.h", |
| 641 | "source/opt/loop_fusion_pass.cpp", |
| 642 | "source/opt/loop_fusion_pass.h", |
| 643 | "source/opt/loop_peeling.cpp", |
| 644 | "source/opt/loop_peeling.h", |
| 645 | "source/opt/loop_unroller.cpp", |
| 646 | "source/opt/loop_unroller.h", |
| 647 | "source/opt/loop_unswitch_pass.cpp", |
| 648 | "source/opt/loop_unswitch_pass.h", |
| 649 | "source/opt/loop_utils.cpp", |
| 650 | "source/opt/loop_utils.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 651 | "source/opt/mem_pass.cpp", |
| 652 | "source/opt/mem_pass.h", |
| 653 | "source/opt/merge_return_pass.cpp", |
| 654 | "source/opt/merge_return_pass.h", |
| 655 | "source/opt/module.cpp", |
| 656 | "source/opt/module.h", |
| 657 | "source/opt/null_pass.h", |
| 658 | "source/opt/optimizer.cpp", |
| 659 | "source/opt/pass.cpp", |
| 660 | "source/opt/pass.h", |
| 661 | "source/opt/pass_manager.cpp", |
| 662 | "source/opt/pass_manager.h", |
| 663 | "source/opt/passes.h", |
| 664 | "source/opt/private_to_local_pass.cpp", |
| 665 | "source/opt/private_to_local_pass.h", |
| 666 | "source/opt/propagator.cpp", |
| 667 | "source/opt/propagator.h", |
| 668 | "source/opt/reduce_load_size.cpp", |
| 669 | "source/opt/reduce_load_size.h", |
| 670 | "source/opt/redundancy_elimination.cpp", |
| 671 | "source/opt/redundancy_elimination.h", |
| 672 | "source/opt/reflect.h", |
| 673 | "source/opt/register_pressure.cpp", |
| 674 | "source/opt/register_pressure.h", |
greg-lunarg | d11725b | 2019-09-03 11:22:13 -0600 | [diff] [blame] | 675 | "source/opt/relax_float_ops_pass.cpp", |
| 676 | "source/opt/relax_float_ops_pass.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 677 | "source/opt/remove_duplicates_pass.cpp", |
| 678 | "source/opt/remove_duplicates_pass.h", |
| 679 | "source/opt/replace_invalid_opc.cpp", |
| 680 | "source/opt/replace_invalid_opc.h", |
| 681 | "source/opt/scalar_analysis.cpp", |
| 682 | "source/opt/scalar_analysis.h", |
| 683 | "source/opt/scalar_analysis_nodes.h", |
| 684 | "source/opt/scalar_analysis_simplification.cpp", |
| 685 | "source/opt/scalar_replacement_pass.cpp", |
| 686 | "source/opt/scalar_replacement_pass.h", |
| 687 | "source/opt/set_spec_constant_default_value_pass.cpp", |
| 688 | "source/opt/set_spec_constant_default_value_pass.h", |
| 689 | "source/opt/simplification_pass.cpp", |
| 690 | "source/opt/simplification_pass.h", |
| 691 | "source/opt/ssa_rewrite_pass.cpp", |
| 692 | "source/opt/ssa_rewrite_pass.h", |
| 693 | "source/opt/strength_reduction_pass.cpp", |
| 694 | "source/opt/strength_reduction_pass.h", |
| 695 | "source/opt/strip_debug_info_pass.cpp", |
| 696 | "source/opt/strip_debug_info_pass.h", |
| 697 | "source/opt/strip_reflect_info_pass.cpp", |
| 698 | "source/opt/strip_reflect_info_pass.h", |
Steven Perron | 5f599e7 | 2018-09-17 13:00:24 -0400 | [diff] [blame] | 699 | "source/opt/struct_cfg_analysis.cpp", |
| 700 | "source/opt/struct_cfg_analysis.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 701 | "source/opt/tree_iterator.h", |
| 702 | "source/opt/type_manager.cpp", |
| 703 | "source/opt/type_manager.h", |
| 704 | "source/opt/types.cpp", |
| 705 | "source/opt/types.h", |
| 706 | "source/opt/unify_const_pass.cpp", |
| 707 | "source/opt/unify_const_pass.h", |
dan sinclair | 67b2e15 | 2018-12-03 09:11:56 -0500 | [diff] [blame] | 708 | "source/opt/upgrade_memory_model.cpp", |
| 709 | "source/opt/upgrade_memory_model.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 710 | "source/opt/value_number_table.cpp", |
| 711 | "source/opt/value_number_table.h", |
| 712 | "source/opt/vector_dce.cpp", |
| 713 | "source/opt/vector_dce.h", |
| 714 | "source/opt/workaround1209.cpp", |
| 715 | "source/opt/workaround1209.h", |
Steven Perron | 60043ed | 2019-08-14 09:27:12 -0400 | [diff] [blame] | 716 | "source/opt/wrap_opkill.cpp", |
| 717 | "source/opt/wrap_opkill.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 718 | ] |
Corentin Wallez | 21bcb9d | 2018-09-06 10:50:27 -0400 | [diff] [blame] | 719 | |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 720 | deps = [ |
| 721 | ":spvtools", |
Shahbaz Youssefi | 1b34410 | 2020-01-24 17:14:16 -0500 | [diff] [blame] | 722 | ":spvtools_language_header_cldebuginfo100", |
| 723 | ":spvtools_language_header_debuginfo", |
Corentin Wallez | 4ae9b71 | 2019-08-30 15:09:34 +0200 | [diff] [blame] | 724 | ":spvtools_vendor_tables_spv-amd-shader-ballot", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 725 | ] |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 726 | public_deps = [ ":spvtools_headers" ] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 727 | |
David Turner | a6bfc26 | 2019-07-03 22:26:06 +0200 | [diff] [blame] | 728 | if (build_with_chromium) { |
| 729 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 730 | configs += [ "//build/config/compiler:no_chromium_code" ] |
| 731 | } |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 732 | configs += [ ":spvtools_internal_config" ] |
| 733 | } |
| 734 | |
| 735 | static_library("spvtools_link") { |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 736 | sources = [ "source/link/linker.cpp" ] |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 737 | deps = [ |
| 738 | ":spvtools", |
Corentin Wallez | 59de04a | 2019-07-12 16:35:59 +0200 | [diff] [blame] | 739 | ":spvtools_opt", |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 740 | ":spvtools_val", |
| 741 | ] |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 742 | public_deps = [ ":spvtools_headers" ] |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 743 | if (build_with_chromium) { |
| 744 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 745 | configs += [ "//build/config/compiler:no_chromium_code" ] |
| 746 | } |
| 747 | configs += [ ":spvtools_internal_config" ] |
| 748 | } |
| 749 | |
| 750 | static_library("spvtools_reduce") { |
| 751 | sources = [ |
| 752 | "source/reduce/change_operand_reduction_opportunity.cpp", |
| 753 | "source/reduce/change_operand_reduction_opportunity.h", |
| 754 | "source/reduce/change_operand_to_undef_reduction_opportunity.cpp", |
| 755 | "source/reduce/change_operand_to_undef_reduction_opportunity.h", |
| 756 | "source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp", |
| 757 | "source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.h", |
| 758 | "source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.cpp", |
| 759 | "source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.h", |
| 760 | "source/reduce/merge_blocks_reduction_opportunity.cpp", |
| 761 | "source/reduce/merge_blocks_reduction_opportunity.h", |
| 762 | "source/reduce/merge_blocks_reduction_opportunity_finder.cpp", |
| 763 | "source/reduce/merge_blocks_reduction_opportunity_finder.h", |
| 764 | "source/reduce/operand_to_const_reduction_opportunity_finder.cpp", |
| 765 | "source/reduce/operand_to_const_reduction_opportunity_finder.h", |
| 766 | "source/reduce/operand_to_dominating_id_reduction_opportunity_finder.cpp", |
| 767 | "source/reduce/operand_to_dominating_id_reduction_opportunity_finder.h", |
| 768 | "source/reduce/operand_to_undef_reduction_opportunity_finder.cpp", |
| 769 | "source/reduce/operand_to_undef_reduction_opportunity_finder.h", |
| 770 | "source/reduce/reducer.cpp", |
| 771 | "source/reduce/reducer.h", |
| 772 | "source/reduce/reduction_opportunity.cpp", |
| 773 | "source/reduce/reduction_opportunity.h", |
Alastair Donaldson | 726af6f | 2020-09-11 22:20:58 +0100 | [diff] [blame] | 774 | "source/reduce/reduction_opportunity_finder.cpp", |
Jamie Madill | e0d5544 | 2019-11-04 21:01:57 -0500 | [diff] [blame] | 775 | "source/reduce/reduction_opportunity_finder.h", |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 776 | "source/reduce/reduction_pass.cpp", |
| 777 | "source/reduce/reduction_pass.h", |
| 778 | "source/reduce/reduction_util.cpp", |
| 779 | "source/reduce/reduction_util.h", |
| 780 | "source/reduce/remove_block_reduction_opportunity.cpp", |
| 781 | "source/reduce/remove_block_reduction_opportunity.h", |
| 782 | "source/reduce/remove_block_reduction_opportunity_finder.cpp", |
| 783 | "source/reduce/remove_block_reduction_opportunity_finder.h", |
| 784 | "source/reduce/remove_function_reduction_opportunity.cpp", |
| 785 | "source/reduce/remove_function_reduction_opportunity.h", |
| 786 | "source/reduce/remove_function_reduction_opportunity_finder.cpp", |
| 787 | "source/reduce/remove_function_reduction_opportunity_finder.h", |
| 788 | "source/reduce/remove_instruction_reduction_opportunity.cpp", |
| 789 | "source/reduce/remove_instruction_reduction_opportunity.h", |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 790 | "source/reduce/remove_selection_reduction_opportunity.cpp", |
| 791 | "source/reduce/remove_selection_reduction_opportunity.h", |
| 792 | "source/reduce/remove_selection_reduction_opportunity_finder.cpp", |
| 793 | "source/reduce/remove_selection_reduction_opportunity_finder.h", |
Ryan Harrison | 95df4c9 | 2020-05-19 15:17:58 -0400 | [diff] [blame] | 794 | "source/reduce/remove_struct_member_reduction_opportunity.cpp", |
| 795 | "source/reduce/remove_struct_member_reduction_opportunity.h", |
| 796 | "source/reduce/remove_unused_instruction_reduction_opportunity_finder.cpp", |
| 797 | "source/reduce/remove_unused_instruction_reduction_opportunity_finder.h", |
| 798 | "source/reduce/remove_unused_struct_member_reduction_opportunity_finder.cpp", |
| 799 | "source/reduce/remove_unused_struct_member_reduction_opportunity_finder.h", |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 800 | "source/reduce/simple_conditional_branch_to_branch_opportunity_finder.cpp", |
| 801 | "source/reduce/simple_conditional_branch_to_branch_opportunity_finder.h", |
| 802 | "source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.cpp", |
| 803 | "source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.h", |
| 804 | "source/reduce/structured_loop_to_selection_reduction_opportunity.cpp", |
| 805 | "source/reduce/structured_loop_to_selection_reduction_opportunity.h", |
| 806 | "source/reduce/structured_loop_to_selection_reduction_opportunity_finder.cpp", |
| 807 | "source/reduce/structured_loop_to_selection_reduction_opportunity_finder.h", |
Corentin Wallez | 59de04a | 2019-07-12 16:35:59 +0200 | [diff] [blame] | 808 | "source/spirv_reducer_options.cpp", |
| 809 | "source/spirv_reducer_options.h", |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 810 | ] |
| 811 | deps = [ |
| 812 | ":spvtools", |
| 813 | ":spvtools_opt", |
| 814 | ] |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 815 | public_deps = [ ":spvtools_headers" ] |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 816 | if (build_with_chromium) { |
| 817 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 818 | configs += [ "//build/config/compiler:no_chromium_code" ] |
| 819 | } |
| 820 | configs += [ ":spvtools_internal_config" ] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 821 | } |
| 822 | |
dan sinclair | a97c1d9 | 2018-08-01 14:28:10 -0400 | [diff] [blame] | 823 | group("SPIRV-Tools") { |
Jamie Madill | 1c9ca42 | 2019-09-03 12:57:32 -0400 | [diff] [blame] | 824 | public_deps = [ |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 825 | ":spvtools", |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 826 | ":spvtools_link", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 827 | ":spvtools_opt", |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 828 | ":spvtools_reduce", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 829 | ":spvtools_val", |
| 830 | ] |
| 831 | } |
| 832 | |
Jamie Madill | 4b42cd1 | 2019-02-19 10:38:38 -0500 | [diff] [blame] | 833 | # The tests are scoped to Chromium to avoid needing to write gtest integration. |
| 834 | # See Chromium's third_party/googletest/BUILD.gn for a complete integration. |
| 835 | if (build_with_chromium) { |
| 836 | test("spvtools_test") { |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 837 | sources = [ |
Jamie Madill | 4b42cd1 | 2019-02-19 10:38:38 -0500 | [diff] [blame] | 838 | "test/assembly_context_test.cpp", |
| 839 | "test/assembly_format_test.cpp", |
| 840 | "test/binary_destroy_test.cpp", |
| 841 | "test/binary_endianness_test.cpp", |
| 842 | "test/binary_header_get_test.cpp", |
| 843 | "test/binary_parse_test.cpp", |
| 844 | "test/binary_strnlen_s_test.cpp", |
| 845 | "test/binary_to_text.literal_test.cpp", |
| 846 | "test/binary_to_text_test.cpp", |
| 847 | "test/comment_test.cpp", |
| 848 | "test/enum_set_test.cpp", |
| 849 | "test/enum_string_mapping_test.cpp", |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 850 | "test/ext_inst.cldebug100_test.cpp", |
Jamie Madill | 4b42cd1 | 2019-02-19 10:38:38 -0500 | [diff] [blame] | 851 | "test/ext_inst.debuginfo_test.cpp", |
| 852 | "test/ext_inst.glsl_test.cpp", |
| 853 | "test/ext_inst.opencl_test.cpp", |
| 854 | "test/fix_word_test.cpp", |
| 855 | "test/generator_magic_number_test.cpp", |
| 856 | "test/hex_float_test.cpp", |
| 857 | "test/immediate_int_test.cpp", |
| 858 | "test/libspirv_macros_test.cpp", |
| 859 | "test/name_mapper_test.cpp", |
| 860 | "test/named_id_test.cpp", |
| 861 | "test/opcode_make_test.cpp", |
| 862 | "test/opcode_require_capabilities_test.cpp", |
| 863 | "test/opcode_split_test.cpp", |
| 864 | "test/opcode_table_get_test.cpp", |
| 865 | "test/operand_capabilities_test.cpp", |
| 866 | "test/operand_pattern_test.cpp", |
| 867 | "test/operand_test.cpp", |
| 868 | "test/target_env_test.cpp", |
| 869 | "test/test_fixture.h", |
| 870 | "test/text_advance_test.cpp", |
| 871 | "test/text_destroy_test.cpp", |
| 872 | "test/text_literal_test.cpp", |
| 873 | "test/text_start_new_inst_test.cpp", |
| 874 | "test/text_to_binary.annotation_test.cpp", |
| 875 | "test/text_to_binary.barrier_test.cpp", |
| 876 | "test/text_to_binary.constant_test.cpp", |
| 877 | "test/text_to_binary.control_flow_test.cpp", |
| 878 | "test/text_to_binary.debug_test.cpp", |
| 879 | "test/text_to_binary.device_side_enqueue_test.cpp", |
| 880 | "test/text_to_binary.extension_test.cpp", |
| 881 | "test/text_to_binary.function_test.cpp", |
| 882 | "test/text_to_binary.group_test.cpp", |
| 883 | "test/text_to_binary.image_test.cpp", |
| 884 | "test/text_to_binary.literal_test.cpp", |
| 885 | "test/text_to_binary.memory_test.cpp", |
| 886 | "test/text_to_binary.misc_test.cpp", |
| 887 | "test/text_to_binary.mode_setting_test.cpp", |
| 888 | "test/text_to_binary.pipe_storage_test.cpp", |
| 889 | "test/text_to_binary.reserved_sampling_test.cpp", |
| 890 | "test/text_to_binary.subgroup_dispatch_test.cpp", |
| 891 | "test/text_to_binary.type_declaration_test.cpp", |
| 892 | "test/text_to_binary_test.cpp", |
| 893 | "test/text_word_get_test.cpp", |
| 894 | "test/unit_spirv.cpp", |
| 895 | "test/unit_spirv.h", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 896 | ] |
| 897 | |
Jamie Madill | 4b42cd1 | 2019-02-19 10:38:38 -0500 | [diff] [blame] | 898 | deps = [ |
Jamie Madill | 4b42cd1 | 2019-02-19 10:38:38 -0500 | [diff] [blame] | 899 | ":spvtools", |
David Neto | 64f36ea | 2019-12-19 17:16:26 -0500 | [diff] [blame] | 900 | ":spvtools_language_header_cldebuginfo100", |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 901 | ":spvtools_language_header_debuginfo", |
Jamie Madill | 4b42cd1 | 2019-02-19 10:38:38 -0500 | [diff] [blame] | 902 | ":spvtools_val", |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 903 | "//testing/gmock", |
| 904 | "//testing/gtest", |
| 905 | "//testing/gtest:gtest_main", |
Jamie Madill | 635b583 | 2019-09-04 12:43:26 -0400 | [diff] [blame] | 906 | "//third_party/googletest:gmock", |
| 907 | "//third_party/googletest:gtest", |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 908 | ] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 909 | |
Jamie Madill | 4b42cd1 | 2019-02-19 10:38:38 -0500 | [diff] [blame] | 910 | if (is_clang) { |
| 911 | cflags_cc = [ "-Wno-self-assign" ] |
| 912 | } |
Corentin Wallez | 21bcb9d | 2018-09-06 10:50:27 -0400 | [diff] [blame] | 913 | |
Jamie Madill | 4b42cd1 | 2019-02-19 10:38:38 -0500 | [diff] [blame] | 914 | configs += [ ":spvtools_internal_config" ] |
| 915 | } |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 916 | } |
| 917 | |
Corentin Wallez | 2d9a325 | 2018-08-02 18:48:03 +0200 | [diff] [blame] | 918 | if (spirv_tools_standalone) { |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 919 | group("fuzzers") { |
| 920 | testonly = true |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 921 | deps = [ "test/fuzzers" ] |
Dan Sinclair | a114e1f | 2018-07-17 13:53:15 -0400 | [diff] [blame] | 922 | } |
| 923 | } |
dan sinclair | 1bdade7 | 2018-08-15 15:26:28 -0400 | [diff] [blame] | 924 | |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 925 | source_set("spvtools_util_cli_consumer") { |
| 926 | sources = [ |
| 927 | "tools/util/cli_consumer.cpp", |
| 928 | "tools/util/cli_consumer.h", |
| 929 | ] |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 930 | deps = [ ":spvtools_headers" ] |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 931 | configs += [ ":spvtools_internal_config" ] |
| 932 | } |
| 933 | |
| 934 | source_set("spvtools_software_version") { |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 935 | sources = [ "source/software_version.cpp" ] |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 936 | deps = [ |
| 937 | ":spvtools_build_version", |
Corentin Wallez | 59de04a | 2019-07-12 16:35:59 +0200 | [diff] [blame] | 938 | ":spvtools_headers", |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 939 | ] |
| 940 | configs += [ ":spvtools_internal_config" ] |
| 941 | } |
| 942 | |
| 943 | executable("spirv-as") { |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 944 | sources = [ "tools/as/as.cpp" ] |
dan sinclair | 1bdade7 | 2018-08-15 15:26:28 -0400 | [diff] [blame] | 945 | deps = [ |
| 946 | ":spvtools", |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 947 | ":spvtools_software_version", |
| 948 | ] |
| 949 | configs += [ ":spvtools_internal_config" ] |
| 950 | } |
| 951 | |
| 952 | executable("spirv-dis") { |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 953 | sources = [ "tools/dis/dis.cpp" ] |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 954 | deps = [ |
| 955 | ":spvtools", |
| 956 | ":spvtools_software_version", |
| 957 | ] |
| 958 | configs += [ ":spvtools_internal_config" ] |
| 959 | } |
| 960 | |
| 961 | executable("spirv-val") { |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 962 | sources = [ "tools/val/val.cpp" ] |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 963 | deps = [ |
| 964 | ":spvtools", |
| 965 | ":spvtools_software_version", |
| 966 | ":spvtools_util_cli_consumer", |
| 967 | ":spvtools_val", |
| 968 | ] |
| 969 | configs += [ ":spvtools_internal_config" ] |
| 970 | } |
| 971 | |
| 972 | executable("spirv-cfg") { |
| 973 | sources = [ |
| 974 | "tools/cfg/bin_to_dot.cpp", |
| 975 | "tools/cfg/bin_to_dot.h", |
| 976 | "tools/cfg/cfg.cpp", |
| 977 | ] |
| 978 | deps = [ |
| 979 | ":spvtools", |
| 980 | ":spvtools_software_version", |
dan sinclair | 1bdade7 | 2018-08-15 15:26:28 -0400 | [diff] [blame] | 981 | ] |
Corentin Wallez | 21bcb9d | 2018-09-06 10:50:27 -0400 | [diff] [blame] | 982 | configs += [ ":spvtools_internal_config" ] |
dan sinclair | 1bdade7 | 2018-08-15 15:26:28 -0400 | [diff] [blame] | 983 | } |
David Turner | a6bfc26 | 2019-07-03 22:26:06 +0200 | [diff] [blame] | 984 | |
| 985 | executable("spirv-opt") { |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 986 | sources = [ "tools/opt/opt.cpp" ] |
David Turner | a6bfc26 | 2019-07-03 22:26:06 +0200 | [diff] [blame] | 987 | deps = [ |
| 988 | ":spvtools", |
| 989 | ":spvtools_opt", |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 990 | ":spvtools_software_version", |
| 991 | ":spvtools_util_cli_consumer", |
David Turner | a6bfc26 | 2019-07-03 22:26:06 +0200 | [diff] [blame] | 992 | ":spvtools_val", |
David Turner | a6bfc26 | 2019-07-03 22:26:06 +0200 | [diff] [blame] | 993 | ] |
| 994 | configs += [ ":spvtools_internal_config" ] |
| 995 | } |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 996 | |
| 997 | executable("spirv-link") { |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 998 | sources = [ "tools/link/linker.cpp" ] |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 999 | deps = [ |
| 1000 | ":spvtools", |
| 1001 | ":spvtools_link", |
| 1002 | ":spvtools_opt", |
| 1003 | ":spvtools_software_version", |
| 1004 | ":spvtools_val", |
| 1005 | ] |
| 1006 | configs += [ ":spvtools_internal_config" ] |
| 1007 | } |
| 1008 | |
Shahbaz Youssefi | ae6a1e1 | 2021-04-12 13:17:44 -0400 | [diff] [blame] | 1009 | if (!is_ios && !spirv_is_winuwp) { |
| 1010 | # iOS and UWP do not allow std::system calls which spirv-reduce requires |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 1011 | executable("spirv-reduce") { |
Corentin Wallez | 77eb2b6 | 2021-03-10 20:19:24 +0000 | [diff] [blame] | 1012 | sources = [ "tools/reduce/reduce.cpp" ] |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 1013 | deps = [ |
| 1014 | ":spvtools", |
Corentin Wallez | 59de04a | 2019-07-12 16:35:59 +0200 | [diff] [blame] | 1015 | ":spvtools_opt", |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 1016 | ":spvtools_reduce", |
| 1017 | ":spvtools_software_version", |
| 1018 | ":spvtools_util_cli_consumer", |
| 1019 | ":spvtools_val", |
| 1020 | ] |
| 1021 | configs += [ ":spvtools_internal_config" ] |
| 1022 | } |
| 1023 | } |
| 1024 | |
| 1025 | group("all_spirv_tools") { |
| 1026 | deps = [ |
| 1027 | ":spirv-as", |
| 1028 | ":spirv-cfg", |
| 1029 | ":spirv-dis", |
| 1030 | ":spirv-link", |
| 1031 | ":spirv-opt", |
| 1032 | ":spirv-val", |
| 1033 | ] |
Shahbaz Youssefi | ae6a1e1 | 2021-04-12 13:17:44 -0400 | [diff] [blame] | 1034 | if (!is_ios && !spirv_is_winuwp) { |
David Turner | 5081512 | 2019-07-10 22:37:10 +0200 | [diff] [blame] | 1035 | deps += [ ":spirv-reduce" ] |
| 1036 | } |
| 1037 | } |