Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 1 | # Copyright 2021 The Dawn & Tint Authors |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2 | # |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 3 | # Redistribution and use in source and binary forms, with or without |
| 4 | # modification, are permitted provided that the following conditions are met: |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 5 | # |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 6 | # 1. Redistributions of source code must retain the above copyright notice, this |
| 7 | # list of conditions and the following disclaimer. |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 8 | # |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 9 | # 2. Redistributions in binary form must reproduce the above copyright notice, |
| 10 | # this list of conditions and the following disclaimer in the documentation |
| 11 | # and/or other materials provided with the distribution. |
| 12 | # |
| 13 | # 3. Neither the name of the copyright holder nor the names of its |
| 14 | # contributors may be used to endorse or promote products derived from |
| 15 | # this software without specific prior written permission. |
| 16 | # |
| 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 20 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 21 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 22 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 23 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 24 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 25 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 27 | |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 28 | # GEN_BUILD:DO_NOT_GENERATE - Don't regenerate this file with `./tools run gen` |
| 29 | |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 30 | import("//build_overrides/build.gni") |
Dan Sinclair | 5ae03c2 | 2022-11-03 14:25:37 +0000 | [diff] [blame] | 31 | |
dan sinclair | 2fe7f19 | 2023-03-07 18:20:23 +0000 | [diff] [blame] | 32 | import("../../scripts/dawn_overrides_with_defaults.gni") |
Ben Clayton | 6663076 | 2023-08-18 08:29:51 +0000 | [diff] [blame] | 33 | import("../../scripts/tint_overrides_with_defaults.gni") |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 34 | |
dan sinclair | 77bf233 | 2022-06-22 12:40:43 +0000 | [diff] [blame] | 35 | if (tint_build_unittests) { |
| 36 | import("//testing/test.gni") |
| 37 | } |
| 38 | |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 39 | import("tint.gni") |
| 40 | |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 41 | ############################################################################### |
| 42 | # Common - Configs, etc. shared across targets |
| 43 | ############################################################################### |
| 44 | |
Ben Clayton | 44a29b5 | 2023-12-04 14:55:01 +0000 | [diff] [blame] | 45 | # tint_gen_dir is the relative path of tint_root_dir to '//', under root_gen_dir |
| 46 | tint_gen_dir = "${root_gen_dir}/" + rebase_path("${tint_root_dir}", "//") |
| 47 | |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 48 | config("tint_common_config") { |
| 49 | include_dirs = [ |
Ben Clayton | 44a29b5 | 2023-12-04 14:55:01 +0000 | [diff] [blame] | 50 | "${tint_root_dir}", |
| 51 | "${tint_gen_dir}", |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 52 | ] |
Arthur Sonzogni | 3aaa0a3 | 2024-05-31 14:01:04 +0000 | [diff] [blame] | 53 | |
| 54 | # Some versions of MSVC ignores the [[noreturn]] on ~InternalCompilerError(), |
| 55 | # triggering a warning if it is the last statement on a function that has a |
| 56 | # return value. |
| 57 | if (!is_clang && is_win) { |
| 58 | cflags = [ "/wd4715" ] |
| 59 | } |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | config("tint_public_config") { |
| 63 | defines = [] |
| 64 | if (tint_build_spv_reader) { |
| 65 | defines += [ "TINT_BUILD_SPV_READER=1" ] |
| 66 | } else { |
| 67 | defines += [ "TINT_BUILD_SPV_READER=0" ] |
| 68 | } |
| 69 | |
| 70 | if (tint_build_spv_writer) { |
| 71 | defines += [ "TINT_BUILD_SPV_WRITER=1" ] |
| 72 | } else { |
| 73 | defines += [ "TINT_BUILD_SPV_WRITER=0" ] |
| 74 | } |
| 75 | |
| 76 | if (tint_build_wgsl_reader) { |
| 77 | defines += [ "TINT_BUILD_WGSL_READER=1" ] |
| 78 | } else { |
| 79 | defines += [ "TINT_BUILD_WGSL_READER=0" ] |
| 80 | } |
| 81 | |
| 82 | if (tint_build_wgsl_writer) { |
| 83 | defines += [ "TINT_BUILD_WGSL_WRITER=1" ] |
| 84 | } else { |
| 85 | defines += [ "TINT_BUILD_WGSL_WRITER=0" ] |
| 86 | } |
| 87 | |
| 88 | if (tint_build_msl_writer) { |
| 89 | defines += [ "TINT_BUILD_MSL_WRITER=1" ] |
| 90 | } else { |
| 91 | defines += [ "TINT_BUILD_MSL_WRITER=0" ] |
| 92 | } |
| 93 | |
| 94 | if (tint_build_hlsl_writer) { |
| 95 | defines += [ "TINT_BUILD_HLSL_WRITER=1" ] |
| 96 | } else { |
| 97 | defines += [ "TINT_BUILD_HLSL_WRITER=0" ] |
| 98 | } |
| 99 | |
| 100 | if (tint_build_glsl_writer) { |
| 101 | defines += [ "TINT_BUILD_GLSL_WRITER=1" ] |
| 102 | } else { |
| 103 | defines += [ "TINT_BUILD_GLSL_WRITER=0" ] |
| 104 | } |
| 105 | |
Ben Clayton | f1b8a01 | 2023-10-11 17:15:52 +0000 | [diff] [blame] | 106 | if (tint_build_glsl_validator) { |
| 107 | defines += [ "TINT_BUILD_GLSL_VALIDATOR=1" ] |
| 108 | } else { |
| 109 | defines += [ "TINT_BUILD_GLSL_VALIDATOR=0" ] |
| 110 | } |
| 111 | |
dan sinclair | 0917fbb | 2023-03-07 18:28:38 +0000 | [diff] [blame] | 112 | if (tint_build_syntax_tree_writer) { |
| 113 | defines += [ "TINT_BUILD_SYNTAX_TREE_WRITER=1" ] |
| 114 | } else { |
| 115 | defines += [ "TINT_BUILD_SYNTAX_TREE_WRITER=0" ] |
| 116 | } |
| 117 | |
Ryan Harrison | 724dd78 | 2024-05-16 16:27:48 +0000 | [diff] [blame] | 118 | if (tint_build_ir_binary) { |
| 119 | defines += [ "TINT_BUILD_IR_BINARY=1" ] |
| 120 | } else { |
| 121 | defines += [ "TINT_BUILD_IR_BINARY=0" ] |
| 122 | } |
| 123 | |
Ben Clayton | 5e1a2a0 | 2024-06-05 21:34:28 +0000 | [diff] [blame] | 124 | if (tint_build_ir_fuzzer) { |
| 125 | defines += [ "TINT_BUILD_IR_FUZZER=1" ] |
| 126 | } else { |
| 127 | defines += [ "TINT_BUILD_IR_FUZZER=0" ] |
| 128 | } |
| 129 | |
Ben Clayton | 5c69ff4 | 2023-11-23 13:32:36 +0000 | [diff] [blame] | 130 | if (tint_build_is_win) { |
| 131 | defines += [ "TINT_BUILD_IS_WIN=1" ] |
| 132 | } else { |
| 133 | defines += [ "TINT_BUILD_IS_WIN=0" ] |
| 134 | } |
| 135 | |
| 136 | if (tint_build_is_mac) { |
| 137 | defines += [ "TINT_BUILD_IS_MAC=1" ] |
| 138 | } else { |
| 139 | defines += [ "TINT_BUILD_IS_MAC=0" ] |
| 140 | } |
| 141 | |
| 142 | if (tint_build_is_linux) { |
| 143 | defines += [ "TINT_BUILD_IS_LINUX=1" ] |
| 144 | } else { |
| 145 | defines += [ "TINT_BUILD_IS_LINUX=0" ] |
| 146 | } |
| 147 | |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 148 | include_dirs = [ |
| 149 | "${tint_root_dir}/", |
| 150 | "${tint_root_dir}/include/", |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 151 | ] |
| 152 | } |
| 153 | |
| 154 | config("tint_config") { |
| 155 | include_dirs = [] |
| 156 | if (tint_build_spv_reader || tint_build_spv_writer) { |
| 157 | include_dirs += [ "${tint_spirv_tools_dir}/include/" ] |
| 158 | } |
| 159 | } |
| 160 | |
James Price | 5976efe | 2024-05-07 13:48:43 +0000 | [diff] [blame] | 161 | source_set("dl") { |
| 162 | # GN doesn't appear to need to depend on any dl libraries. |
| 163 | } |
| 164 | |
Ben Clayton | 30b420d | 2023-08-22 10:30:58 +0000 | [diff] [blame] | 165 | source_set("thread") { |
| 166 | # GN doesn't appear to need to depend on any thread libraries. |
| 167 | } |
| 168 | |
Ben Clayton | e977f54 | 2023-08-22 10:30:58 +0000 | [diff] [blame] | 169 | source_set("metal") { |
| 170 | frameworks = [ |
Ben Clayton | 89b9828 | 2023-09-05 16:28:13 +0000 | [diff] [blame] | 171 | "CoreGraphics.framework", |
Ben Clayton | e977f54 | 2023-08-22 10:30:58 +0000 | [diff] [blame] | 172 | "Foundation.framework", |
| 173 | "Metal.framework", |
| 174 | ] |
| 175 | } |
| 176 | |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 177 | config("tint_unittests_config") { |
| 178 | include_dirs = [ |
| 179 | "${tint_googletest_dir}/googlemock/include", |
| 180 | "${tint_googletest_dir}/googletest/include", |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 181 | ] |
| 182 | |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 183 | configs = [ |
| 184 | ":tint_common_config", |
| 185 | ":tint_public_config", |
dan sinclair | 2da119a | 2023-01-25 18:39:00 +0000 | [diff] [blame] | 186 | ] |
| 187 | |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 188 | if (is_win && is_debug) { |
| 189 | # TODO(crbug.com/tint/1749): both msvc and clang builds stack overflow on debug builds. |
| 190 | # Increase the initial stack size to 4 MB (default is 1MB). |
| 191 | ldflags = [ "/STACK:4194304" ] |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 192 | } |
| 193 | } |
dan sinclair | 889a499 | 2022-06-17 13:01:59 +0000 | [diff] [blame] | 194 | |
dan sinclair | 77bf233 | 2022-06-22 12:40:43 +0000 | [diff] [blame] | 195 | if (tint_build_unittests) { |
| 196 | ############################################################################### |
| 197 | # Gtest Gmock - Handle building inside and outside of Chromium. |
| 198 | ############################################################################### |
| 199 | # When building outside of Chromium we need to define our own targets for GTest |
| 200 | # and GMock. However when compiling inside of Chromium we need to reuse the |
| 201 | # existing targets, both because Chromium has a special harness for swarming |
| 202 | # and because otherwise the "gn check" fails. |
dan sinclair | 889a499 | 2022-06-17 13:01:59 +0000 | [diff] [blame] | 203 | |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 204 | if (build_with_chromium) { |
| 205 | # When we are in Chromium we reuse its targets, and also add some deps that |
| 206 | # are needed to launch the test in swarming mode. |
| 207 | group("gmock_and_gtest") { |
| 208 | testonly = true |
| 209 | public_deps = [ |
| 210 | "//base", |
| 211 | "//base/test:test_support", |
| 212 | "//testing/gmock", |
| 213 | "//testing/gtest", |
| 214 | "//third_party/googletest:gmock", |
| 215 | ] |
| 216 | } |
| 217 | } else { |
dan sinclair | 77bf233 | 2022-06-22 12:40:43 +0000 | [diff] [blame] | 218 | # When we aren't in Chromium we define out own targets based on the location |
| 219 | # of the googletest repo. |
| 220 | config("gtest_config") { |
| 221 | include_dirs = [ |
| 222 | "${tint_googletest_dir}/googletest", |
| 223 | "${tint_googletest_dir}/googletest/include", |
| 224 | ] |
| 225 | } |
| 226 | static_library("gtest") { |
| 227 | testonly = true |
| 228 | sources = [ "${tint_googletest_dir}/googletest/src/gtest-all.cc" ] |
| 229 | public_configs = [ ":gtest_config" ] |
| 230 | } |
| 231 | |
| 232 | config("gmock_config") { |
| 233 | include_dirs = [ |
| 234 | "${tint_googletest_dir}/googlemock", |
| 235 | "${tint_googletest_dir}/googlemock/include", |
| 236 | "${tint_googletest_dir}/googletest/include", |
| 237 | ] |
| 238 | } |
| 239 | |
| 240 | static_library("gmock") { |
| 241 | testonly = true |
| 242 | sources = [ "${tint_googletest_dir}/googlemock/src/gmock-all.cc" ] |
| 243 | public_configs = [ ":gmock_config" ] |
| 244 | } |
| 245 | |
| 246 | group("gmock_and_gtest") { |
| 247 | testonly = true |
| 248 | public_deps = [ |
| 249 | ":gmock", |
| 250 | ":gtest", |
| 251 | ] |
| 252 | } |
dan sinclair | 889a499 | 2022-06-17 13:01:59 +0000 | [diff] [blame] | 253 | } |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 254 | } |
dan sinclair | 77bf233 | 2022-06-22 12:40:43 +0000 | [diff] [blame] | 255 | |
Ben Clayton | 9d1b610 | 2023-09-29 12:12:48 +0000 | [diff] [blame] | 256 | if (tint_build_benchmarks) { |
| 257 | group("google_benchmark") { |
| 258 | testonly = true |
Ben Clayton | 089347a | 2023-09-30 04:19:28 +0000 | [diff] [blame] | 259 | public_deps = [ "//third_party/google_benchmark" ] |
Ben Clayton | 9d1b610 | 2023-09-29 12:12:48 +0000 | [diff] [blame] | 260 | } |
James Price | b7b0463 | 2024-08-28 15:19:21 +0000 | [diff] [blame] | 261 | action("generate_benchmark_inputs") { |
| 262 | generated_header_relpath = "gen/src/tint/cmd/bench/benchmark_inputs.h" |
| 263 | generated_header_abspath = "${root_build_dir}/${generated_header_relpath}" |
| 264 | outputs = [ generated_header_abspath ] |
| 265 | script = "${tint_src_dir}/cmd/bench/generate_benchmark_inputs.py" |
| 266 | depfile = "${generated_header_abspath}.d" |
| 267 | args = [ |
| 268 | "header", |
| 269 | rebase_path(root_build_dir, root_build_dir), |
| 270 | generated_header_relpath, |
| 271 | ] |
| 272 | } |
Ben Clayton | 9d1b610 | 2023-09-29 12:12:48 +0000 | [diff] [blame] | 273 | } |
| 274 | |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 275 | group("abseil") { |
Geoff Lang | d32858a | 2024-05-10 19:30:23 +0000 | [diff] [blame] | 276 | # When building within Chromium or ANGLE we need to include "//third_party/abseil-cpp:absl" while |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 277 | # it's beneficial to be more specific with standalone Dawn, especially when it comes to |
| 278 | # including it as a dependency in other projects (such as Skia). |
Geoff Lang | d32858a | 2024-05-10 19:30:23 +0000 | [diff] [blame] | 279 | if (build_with_chromium || build_with_angle) { |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 280 | public_deps = [ "$dawn_abseil_dir:absl" ] |
| 281 | } else { |
Geoff Lang | ed672dd | 2024-04-29 14:26:28 +0000 | [diff] [blame] | 282 | public_deps = [ "${dawn_root}/third_party/gn/abseil-cpp:strings" ] |
dan sinclair | 77bf233 | 2022-06-22 12:40:43 +0000 | [diff] [blame] | 283 | } |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 284 | } |
dan sinclair | 77bf233 | 2022-06-22 12:40:43 +0000 | [diff] [blame] | 285 | |
dan sinclair | 46bd2e1 | 2023-08-21 20:47:36 +0000 | [diff] [blame] | 286 | source_set("winsock") { |
| 287 | libs = [ "ws2_32.lib" ] |
| 288 | } |
| 289 | |
Antonio Maiorano | 4ac690d | 2024-05-01 17:56:33 +0000 | [diff] [blame] | 290 | config("dxc-include-config") { |
| 291 | include_dirs = [ "${dawn_dxc_dir}/include" ] |
| 292 | } |
| 293 | source_set("dxc-include") { |
| 294 | public_configs = [ ":dxc-include-config" ] |
| 295 | } |
| 296 | |
Antonio Maiorano | 49be28e | 2024-06-19 02:11:43 +0000 | [diff] [blame] | 297 | source_set("dxcompiler-for-fuzzer") { |
James Price | 92f1ed3 | 2024-06-21 17:58:59 +0000 | [diff] [blame] | 298 | if (defined(use_libfuzzer) && use_libfuzzer && |
| 299 | (is_win || is_linux || is_mac) && target_cpu != "x86") { |
Antonio Maiorano | 49be28e | 2024-06-19 02:11:43 +0000 | [diff] [blame] | 300 | public_deps = [ "${dawn_dxc_dir}/../gn/dxc:dxcompiler" ] |
| 301 | } |
| 302 | } |
| 303 | |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 304 | ############################################################################### |
Ben Clayton | 6ab5462 | 2023-10-02 18:40:36 +0000 | [diff] [blame] | 305 | # Fuzzers |
| 306 | ############################################################################### |
Jim Van Verth | ac72499 | 2023-10-06 17:21:52 +0000 | [diff] [blame] | 307 | if (tint_has_fuzzers) { |
| 308 | action("tint_generate_wgsl_corpus") { |
| 309 | script = "${tint_src_dir}/cmd/fuzz/wgsl/generate_wgsl_corpus.py" |
Ryan Harrison | c7d4205 | 2024-05-22 04:38:49 +0000 | [diff] [blame] | 310 | sources = [ "${script}" ] |
Jim Van Verth | ac72499 | 2023-10-06 17:21:52 +0000 | [diff] [blame] | 311 | args = [ |
| 312 | "--stamp=" + rebase_path(fuzzer_corpus_wgsl_stamp, root_build_dir), |
| 313 | rebase_path("${tint_root_dir}/test", root_build_dir), |
| 314 | rebase_path(fuzzer_corpus_wgsl_dir, root_build_dir), |
| 315 | ] |
| 316 | outputs = [ fuzzer_corpus_wgsl_stamp ] |
| 317 | } |
Ryan Harrison | c7d4205 | 2024-05-22 04:38:49 +0000 | [diff] [blame] | 318 | |
Ben Clayton | 5e1a2a0 | 2024-06-05 21:34:28 +0000 | [diff] [blame] | 319 | if (tint_build_ir_fuzzer) { |
| 320 | if (tint_build_cmds && tint_build_wgsl_reader && tint_build_ir_binary) { |
Ryan Harrison | c7d4205 | 2024-05-22 04:38:49 +0000 | [diff] [blame] | 321 | action("tint_generate_ir_corpus") { |
Ryan Harrison | 7a53b7c | 2024-06-27 20:10:18 +0000 | [diff] [blame] | 322 | script = "${tint_src_dir}/cmd/fuzz/ir/generate_ir_corpus.py" |
Ryan Harrison | c7d4205 | 2024-05-22 04:38:49 +0000 | [diff] [blame] | 323 | sources = [ "${script}" ] |
Ryan Harrison | f57533d | 2024-06-26 02:01:24 +0000 | [diff] [blame] | 324 | deps = [ "${tint_src_dir}/cmd/fuzz/ir/as" ] |
Ryan Harrison | c7d4205 | 2024-05-22 04:38:49 +0000 | [diff] [blame] | 325 | args = [ |
| 326 | "--stamp=" + rebase_path(fuzzer_corpus_ir_stamp, root_build_dir), |
Ryan Harrison | f57533d | 2024-06-26 02:01:24 +0000 | [diff] [blame] | 327 | rebase_path("${root_build_dir}/ir_fuzz_as", root_build_dir), |
Ryan Harrison | c7d4205 | 2024-05-22 04:38:49 +0000 | [diff] [blame] | 328 | rebase_path("${tint_root_dir}/test", root_build_dir), |
| 329 | rebase_path(fuzzer_corpus_ir_dir, root_build_dir), |
| 330 | ] |
| 331 | outputs = [ fuzzer_corpus_ir_stamp ] |
| 332 | } |
| 333 | } |
| 334 | } |
Ben Clayton | 6ab5462 | 2023-10-02 18:40:36 +0000 | [diff] [blame] | 335 | } |
| 336 | |
| 337 | ############################################################################### |
Ben Clayton | d283e95 | 2023-10-10 15:30:56 +0000 | [diff] [blame] | 338 | # Groups |
| 339 | ############################################################################### |
| 340 | group("libs") { |
| 341 | deps = [ "${tint_src_dir}/api" ] |
| 342 | } |
| 343 | |
| 344 | group("cmds") { |
Ben Clayton | 49a564c | 2023-10-11 16:04:52 +0000 | [diff] [blame] | 345 | deps = [] |
| 346 | if (tint_build_cmds) { |
| 347 | deps += [ |
Ben Clayton | b383cf0 | 2023-11-11 19:13:28 +0000 | [diff] [blame] | 348 | "${tint_src_dir}/cmd/info", |
Ben Clayton | 49a564c | 2023-10-11 16:04:52 +0000 | [diff] [blame] | 349 | "${tint_src_dir}/cmd/remote_compile", |
| 350 | "${tint_src_dir}/cmd/tint", |
| 351 | ] |
Ben Clayton | d283e95 | 2023-10-10 15:30:56 +0000 | [diff] [blame] | 352 | } |
Ben Clayton | f9a5b71 | 2024-03-13 17:37:33 +0000 | [diff] [blame] | 353 | if (tint_build_tintd) { |
| 354 | deps += [ "${tint_src_dir}/cmd/tintd" ] |
| 355 | } |
Ryan Harrison | c020a0e | 2024-07-09 20:44:51 +0000 | [diff] [blame] | 356 | if (tint_build_ir_fuzzer && tint_build_ir_binary) { |
| 357 | if (tint_build_wgsl_reader) { |
| 358 | deps += [ "${tint_src_dir}/cmd/fuzz/ir/as" ] |
| 359 | } |
Ryan Harrison | de1a480 | 2024-07-11 02:01:40 +0000 | [diff] [blame] | 360 | if (tint_build_wgsl_writer && tint_build_spv_writer) { |
Ryan Harrison | c020a0e | 2024-07-09 20:44:51 +0000 | [diff] [blame] | 361 | deps += [ "${tint_src_dir}/cmd/fuzz/ir/dis" ] |
| 362 | } |
| 363 | } |
Ben Clayton | d283e95 | 2023-10-10 15:30:56 +0000 | [diff] [blame] | 364 | } |
| 365 | |
| 366 | group("fuzzers") { |
| 367 | testonly = true |
| 368 | deps = [] |
| 369 | if (tint_has_fuzzers) { |
Ben Clayton | 2468be5 | 2024-04-29 15:26:16 +0000 | [diff] [blame] | 370 | deps += [ "${tint_src_dir}/cmd/fuzz/wgsl" ] |
Ben Clayton | d283e95 | 2023-10-10 15:30:56 +0000 | [diff] [blame] | 371 | } |
Ben Clayton | 5e1a2a0 | 2024-06-05 21:34:28 +0000 | [diff] [blame] | 372 | |
Ryan Harrison | 88e0d75 | 2024-06-14 02:02:10 +0000 | [diff] [blame] | 373 | if (tint_build_ir_fuzzer && (!is_asan || build_with_chromium)) { |
Ben Clayton | 5e1a2a0 | 2024-06-05 21:34:28 +0000 | [diff] [blame] | 374 | deps += [ "${tint_src_dir}/cmd/fuzz/ir" ] |
| 375 | } |
Ben Clayton | d283e95 | 2023-10-10 15:30:56 +0000 | [diff] [blame] | 376 | } |
| 377 | |
| 378 | group("tests") { |
| 379 | testonly = true |
| 380 | deps = [] |
| 381 | if (tint_build_unittests) { |
| 382 | deps += [ "${tint_src_dir}/cmd/test:test_cmd" ] |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | group("benchmarks") { |
| 387 | testonly = true |
| 388 | deps = [] |
James Price | b7b0463 | 2024-08-28 15:19:21 +0000 | [diff] [blame] | 389 | if (tint_build_benchmarks && tint_build_wgsl_reader) { |
Ben Clayton | d283e95 | 2023-10-10 15:30:56 +0000 | [diff] [blame] | 390 | deps += [ "${tint_src_dir}/cmd/bench:bench_cmd" ] |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | ############################################################################### |
Ben Clayton | 6ab5462 | 2023-10-02 18:40:36 +0000 | [diff] [blame] | 395 | # Aliases |
Ben Clayton | 7d81e55 | 2023-08-17 12:01:50 +0000 | [diff] [blame] | 396 | ############################################################################### |
Ben Clayton | d283e95 | 2023-10-10 15:30:56 +0000 | [diff] [blame] | 397 | group("tint_unittests") { |
| 398 | testonly = true |
| 399 | public_deps = [ ":tests" ] |
dan sinclair | 889a499 | 2022-06-17 13:01:59 +0000 | [diff] [blame] | 400 | } |