Zachary Anderson | 7e1b7e5 | 2016-09-23 14:47:36 | [diff] [blame] | 1 | # Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 | # for details. All rights reserved. Use of this source code is governed by a |
| 3 | # BSD-style license that can be found in the LICENSE file. |
| 4 | |
Jake Ehrlich | 773f8d5 | 2019-07-30 20:34:31 | [diff] [blame] | 5 | import("build/config/gclient_args.gni") |
Nicholas Shahan | 50d972b | 2019-10-09 23:24:21 | [diff] [blame] | 6 | import("sdk_args.gni") |
Zachary Anderson | a99cdab | 2017-11-02 19:02:18 | [diff] [blame] | 7 | |
Josh Soref | f7a2ea5 | 2023-01-24 18:00:25 | [diff] [blame] | 8 | targeting_fuchsia = target_os == "fuchsia" |
James Robinson | 138d587 | 2018-01-18 06:05:56 | [diff] [blame] | 9 | |
Zachary Anderson | 7e1b7e5 | 2016-09-23 14:47:36 | [diff] [blame] | 10 | # This target will be built if no target is specified when invoking ninja. |
| 11 | group("default") { |
Josh Soref | f7a2ea5 | 2023-01-24 18:00:25 | [diff] [blame] | 12 | if (targeting_fuchsia) { |
Zachary Anderson | 7f55ad8 | 2016-12-13 21:02:52 | [diff] [blame] | 13 | # Fuchsia has run_vm_tests marked testonly. |
| 14 | testonly = true |
| 15 | } |
asiva | e33d023 | 2020-03-10 21:56:11 | [diff] [blame] | 16 | deps = [ ":runtime" ] |
Zachary Anderson | 7e1b7e5 | 2016-09-23 14:47:36 | [diff] [blame] | 17 | } |
| 18 | |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 19 | group("most") { |
lambdabaa | d3fbbf8 | 2019-07-31 12:54:52 | [diff] [blame] | 20 | import("runtime/runtime_args.gni") |
Josh Soref | f7a2ea5 | 2023-01-24 18:00:25 | [diff] [blame] | 21 | if (targeting_fuchsia) { |
Zachary Anderson | 7f55ad8 | 2016-12-13 21:02:52 | [diff] [blame] | 22 | # Fuchsia has run_vm_tests marked testonly. |
| 23 | testonly = true |
| 24 | } |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 25 | deps = [ |
Alexander Thomas | f38081d | 2021-03-19 12:03:48 | [diff] [blame] | 26 | ":analysis_server", |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 27 | ":create_sdk", |
| 28 | ":dart2js", |
| 29 | ":dartanalyzer", |
| 30 | ":dartdevc", |
| 31 | ":runtime", |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 32 | ] |
| 33 | } |
| 34 | |
Zachary Anderson | 7e1b7e5 | 2016-09-23 14:47:36 | [diff] [blame] | 35 | group("runtime") { |
asiva | bc7220a | 2018-06-18 22:31:32 | [diff] [blame] | 36 | import("runtime/runtime_args.gni") |
| 37 | |
Josh Soref | f7a2ea5 | 2023-01-24 18:00:25 | [diff] [blame] | 38 | if (targeting_fuchsia) { |
Zachary Anderson | 7f55ad8 | 2016-12-13 21:02:52 | [diff] [blame] | 39 | # Fuchsia has run_vm_tests marked testonly. |
| 40 | testonly = true |
| 41 | } |
Chris Evans | 23b1f38 | 2022-03-09 14:17:44 | [diff] [blame] | 42 | |
Zachary Anderson | 7e1b7e5 | 2016-09-23 14:47:36 | [diff] [blame] | 43 | deps = [ |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 44 | "runtime/bin:dart", |
Vyacheslav Egorov | bda70c8 | 2021-09-02 14:14:35 | [diff] [blame] | 45 | "runtime/bin:entrypoints_verification_test", |
Alexander Aprelev | 34087a6 | 2019-09-27 21:14:11 | [diff] [blame] | 46 | "runtime/bin:ffi_test_dynamic_library", |
| 47 | "runtime/bin:ffi_test_functions", |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 48 | "runtime/bin:process_test", |
Zachary Anderson | c1313a5 | 2016-10-26 15:50:54 | [diff] [blame] | 49 | "runtime/bin:run_vm_tests", |
Zachary Anderson | 02eebb0 | 2017-11-01 21:13:28 | [diff] [blame] | 50 | "runtime/vm:kernel_platform_files($host_toolchain)", |
Ryan Macnak | 9eb216a | 2017-01-31 17:47:51 | [diff] [blame] | 51 | "utils/kernel-service:kernel-service", |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 52 | ] |
Ben Konyi | 48aa020 | 2020-05-05 22:27:09 | [diff] [blame] | 53 | |
| 54 | # TODO(bkonyi): this dep causes a segfault on Android XARM_X64 builds. |
| 55 | # See issue #41776. |
| 56 | if (dart_target_arch != "arm") { |
Ben Konyi | 157ebfe | 2020-07-21 16:23:18 | [diff] [blame] | 57 | deps += [ |
| 58 | "utils/dartdev:dartdev", |
| 59 | "utils/dds:dds", |
| 60 | ] |
Ben Konyi | 48aa020 | 2020-05-05 22:27:09 | [diff] [blame] | 61 | } |
Zach Anderson | 5dc1f8d | 2021-05-27 21:50:24 | [diff] [blame] | 62 | |
Chris Evans | 0b8ab17 | 2023-01-24 14:07:26 | [diff] [blame] | 63 | # This flag is set in runtime/runtime_args.gni |
| 64 | # The analyze_snapshot tool is only supported on 64 bit AOT builds running |
| 65 | # under linux and android platforms |
| 66 | if (build_analyze_snapshot) { |
Martin Kustermann | b15da0b | 2023-01-27 12:44:30 | [diff] [blame] | 67 | deps += [ |
| 68 | # The `analyze_snapshot` tests require the `analyze_snapshot` as well as |
| 69 | # `gen_snapshot` binaries. |
| 70 | "runtime/bin:analyze_snapshot", |
| 71 | "runtime/bin:analyze_snapshot($host_toolchain)", |
| 72 | "runtime/bin:gen_snapshot", |
| 73 | "runtime/bin:gen_snapshot($host_toolchain)", |
| 74 | ] |
Chris Evans | 23b1f38 | 2022-03-09 14:17:44 | [diff] [blame] | 75 | } |
| 76 | |
Zach Anderson | 5dc1f8d | 2021-05-27 21:50:24 | [diff] [blame] | 77 | if (is_linux || is_android) { |
| 78 | deps += [ "runtime/bin:abstract_socket_test" ] |
| 79 | } |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 80 | } |
| 81 | |
Daco Harkes | 9f96aed | 2020-11-16 16:10:55 | [diff] [blame] | 82 | # A separate target and not included in group("runtime"). This way the target\ |
| 83 | # "runtime" does not get many executables extra as build output. |
| 84 | group("run_ffi_unit_tests") { |
| 85 | deps = [ "runtime/bin/ffi_unit_test:run_ffi_unit_tests" ] |
| 86 | } |
| 87 | |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 88 | group("runtime_precompiled") { |
| 89 | deps = [ |
Zachary Anderson | c1313a5 | 2016-10-26 15:50:54 | [diff] [blame] | 90 | "runtime/bin:dart_precompiled_runtime", |
Florian Schneider | c7aba7d | 2017-01-10 00:58:09 | [diff] [blame] | 91 | "runtime/bin:process_test", |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 92 | ] |
Zach Anderson | 5dc1f8d | 2021-05-27 21:50:24 | [diff] [blame] | 93 | if (is_linux || is_android) { |
| 94 | deps += [ "runtime/bin:abstract_socket_test" ] |
| 95 | } |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 96 | } |
| 97 | |
Leaf Petersen | d44457f | 2020-06-16 23:37:36 | [diff] [blame] | 98 | group("create_sdk") { |
| 99 | public_deps = [ "sdk:create_sdk" ] |
Robert Nystrom | 6d86779 | 2019-09-25 00:43:13 | [diff] [blame] | 100 | } |
| 101 | |
Leaf Petersen | d44457f | 2020-06-16 23:37:36 | [diff] [blame] | 102 | group("create_platform_sdk") { |
| 103 | public_deps = [ "sdk:create_platform_sdk" ] |
Ben Konyi | 1960d21 | 2020-05-12 23:37:19 | [diff] [blame] | 104 | } |
| 105 | |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 106 | group("dart2js") { |
asiva | e33d023 | 2020-03-10 21:56:11 | [diff] [blame] | 107 | deps = [ "utils/compiler:dart2js" ] |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 108 | } |
| 109 | |
Joshua Litt | fd39eab | 2022-10-05 11:55:22 | [diff] [blame] | 110 | group("dart2wasm_platform") { |
Aske Simon Christensen | 6c76042 | 2022-05-10 10:06:06 | [diff] [blame] | 111 | deps = [ |
| 112 | ":runtime_precompiled", |
| 113 | "utils/dart2wasm:compile_dart2wasm_platform", |
Aske Simon Christensen | 6c76042 | 2022-05-10 10:06:06 | [diff] [blame] | 114 | "utils/dart2wasm:dart2wasm_snapshot", |
Joshua Litt | fd39eab | 2022-10-05 11:55:22 | [diff] [blame] | 115 | ] |
Joshua Litt | 1ed2a07 | 2022-10-26 17:04:17 | [diff] [blame] | 116 | if (defined(is_product)) { |
| 117 | if (is_product) { |
| 118 | deps += [ "utils/dart2wasm:dart2wasm_product_snapshot" ] |
| 119 | } else { |
| 120 | deps += [ "utils/dart2wasm:dart2wasm_asserts_snapshot" ] |
| 121 | } |
Ryan Macnak | 8d60495 | 2022-10-10 19:14:58 | [diff] [blame] | 122 | } |
Joshua Litt | fd39eab | 2022-10-05 11:55:22 | [diff] [blame] | 123 | } |
| 124 | |
| 125 | group("dart2wasm") { |
| 126 | deps = [ |
| 127 | ":dart2wasm_platform", |
Ömer Sinan Ağacan | affc339 | 2022-09-23 09:41:22 | [diff] [blame] | 128 | "utils/dart2wasm:test_wasm_modules", |
Aske Simon Christensen | 6c76042 | 2022-05-10 10:06:06 | [diff] [blame] | 129 | ] |
| 130 | } |
| 131 | |
Martin Kustermann | 0fdeaee | 2022-11-18 10:58:54 | [diff] [blame] | 132 | group("dart2wasm_benchmark") { |
| 133 | deps = [ |
| 134 | ":dart2wasm_platform", |
| 135 | "third_party/binaryen:wasm-opt", |
| 136 | ] |
| 137 | } |
| 138 | |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 139 | group("dartanalyzer") { |
asiva | e33d023 | 2020-03-10 21:56:11 | [diff] [blame] | 140 | deps = [ "utils/dartanalyzer" ] |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | group("dartdevc") { |
asiva | e33d023 | 2020-03-10 21:56:11 | [diff] [blame] | 144 | deps = [ "utils/dartdevc" ] |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 145 | } |
| 146 | |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 147 | group("analysis_server") { |
asiva | e33d023 | 2020-03-10 21:56:11 | [diff] [blame] | 148 | deps = [ "utils/analysis_server" ] |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | # This is the target that is built on the dart2js build bots. |
| 152 | # It must depend on anything that is required by the dart2js |
| 153 | # test suites. |
| 154 | group("dart2js_bot") { |
asiva | e33d023 | 2020-03-10 21:56:11 | [diff] [blame] | 155 | deps = [ ":create_sdk" ] |
Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 156 | } |
| 157 | |
Zach Anderson | 9847c06 | 2018-06-04 21:35:39 | [diff] [blame] | 158 | # This rule and the compressed_observatory_archive rule are for the Fuchsia |
| 159 | # bots that pre-build the Observatory. They copy the observatory tar files to |
| 160 | # the root build output directory for convenient access by the Fuchsia buildbot |
| 161 | # scripts. |
Zach Anderson | 736ddd9 | 2018-05-29 16:35:34 | [diff] [blame] | 162 | group("observatory_archive") { |
asiva | e33d023 | 2020-03-10 21:56:11 | [diff] [blame] | 163 | deps = [ "runtime/observatory:copy_observatory_archive" ] |
Zach Anderson | 9847c06 | 2018-06-04 21:35:39 | [diff] [blame] | 164 | } |
| 165 | |
| 166 | group("compressed_observatory_archive") { |
asiva | e33d023 | 2020-03-10 21:56:11 | [diff] [blame] | 167 | deps = [ "runtime/observatory:copy_compressed_observatory_archive" ] |
Zach Anderson | 736ddd9 | 2018-05-29 16:35:34 | [diff] [blame] | 168 | } |
Liam Appelbe | 089d6fc | 2020-07-10 18:10:05 | [diff] [blame] | 169 | |
| 170 | if (is_fuchsia) { |
Ryan Macnak | b4b7b8f | 2021-10-13 21:14:56 | [diff] [blame] | 171 | import("third_party/fuchsia/sdk/${host_os}/build/component.gni") |
| 172 | import("third_party/fuchsia/sdk/${host_os}/build/package.gni") |
Liam Appelbe | 089d6fc | 2020-07-10 18:10:05 | [diff] [blame] | 173 | |
Daco Harkes | 550d580 | 2020-12-10 12:15:17 | [diff] [blame] | 174 | template("dart_fuchsia_test_package") { |
| 175 | fuchsia_package(target_name) { |
| 176 | package_name = invoker.package_name |
| 177 | if (is_debug) { |
| 178 | package_name += "_debug" |
| 179 | } else if (is_release) { |
| 180 | package_name += "_release" |
| 181 | } else if (is_product) { |
| 182 | package_name += "_product" |
| 183 | } |
| 184 | testonly = true |
| 185 | deps = invoker.deps |
| 186 | } |
| 187 | } |
Liam Appelbe | 6fc75e6 | 2020-07-15 20:44:06 | [diff] [blame] | 188 | |
Daco Harkes | 550d580 | 2020-12-10 12:15:17 | [diff] [blame] | 189 | template("dart_fuchsia_test_component") { |
| 190 | fuchsia_component(target_name) { |
| 191 | testonly = true |
| 192 | data_deps = [ "runtime/bin:dart" ] |
| 193 | if (defined(invoker.data_deps)) { |
| 194 | data_deps += invoker.data_deps |
| 195 | } |
Ryan Macnak | 384394b | 2023-02-09 22:43:36 | [diff] [blame] | 196 | manifest = invoker.manifest |
Daco Harkes | 550d580 | 2020-12-10 12:15:17 | [diff] [blame] | 197 | |
| 198 | library_files = [] |
| 199 | if (defined(invoker.library_files)) { |
| 200 | library_files += invoker.library_files |
| 201 | } |
| 202 | resource_files = [ |
| 203 | ".dart_tool/package_config.json", |
| 204 | "pkg/testing/test/hello_test.dart", |
| 205 | "tools/addlatexhash.dart", |
| 206 | ] |
| 207 | resource_dirs = invoker.resource_dirs |
| 208 | |
| 209 | resources = [] |
| 210 | foreach(file, library_files) { |
| 211 | resources += [ |
| 212 | { |
| 213 | path = root_out_dir + "/" + file |
| 214 | dest = "lib/" + file |
| 215 | }, |
| 216 | ] |
| 217 | } |
| 218 | foreach(file, resource_files) { |
| 219 | resources += [ |
| 220 | { |
| 221 | path = file |
| 222 | dest = "data/" + file |
| 223 | }, |
| 224 | ] |
| 225 | } |
| 226 | resources += |
| 227 | exec_script("tools/fuchsia/find_resources.py", resource_dirs, "json") |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | dart_fuchsia_test_component("fuchsia_test_component") { |
Ryan Macnak | 384394b | 2023-02-09 22:43:36 | [diff] [blame] | 232 | manifest = "build/fuchsia/fuchsia_test_component.cmx" |
Liam Appelbe | 6fc75e6 | 2020-07-15 20:44:06 | [diff] [blame] | 233 | resource_dirs = [ |
Liam Appelbe | 6bd220f | 2020-08-06 21:29:29 | [diff] [blame] | 234 | "tests/standalone_2", |
Liam Appelbe | 6fc75e6 | 2020-07-15 20:44:06 | [diff] [blame] | 235 | "pkg/async_helper", |
| 236 | "pkg/expect", |
| 237 | "pkg/meta", |
Liam Appelbe | 6bd220f | 2020-08-06 21:29:29 | [diff] [blame] | 238 | "pkg/native_stack_traces", |
Liam Appelbe | 6fc75e6 | 2020-07-15 20:44:06 | [diff] [blame] | 239 | "pkg/smith", |
| 240 | "third_party/pkg/args", |
| 241 | "third_party/pkg/async", |
| 242 | "third_party/pkg/collection", |
Liam Appelbe | 6bd220f | 2020-08-06 21:29:29 | [diff] [blame] | 243 | "third_party/pkg/convert", |
| 244 | "third_party/pkg/crypto", |
| 245 | "third_party/pkg/http", |
| 246 | "third_party/pkg/http_parser", |
Liam Appelbe | 6fc75e6 | 2020-07-15 20:44:06 | [diff] [blame] | 247 | "third_party/pkg/path", |
| 248 | "third_party/pkg/pool", |
| 249 | "third_party/pkg/stack_trace", |
Liam Appelbe | 6bd220f | 2020-08-06 21:29:29 | [diff] [blame] | 250 | "third_party/pkg/string_scanner", |
| 251 | "third_party/pkg/typed_data", |
Liam Appelbe | 6fc75e6 | 2020-07-15 20:44:06 | [diff] [blame] | 252 | ] |
Liam Appelbe | 089d6fc | 2020-07-10 18:10:05 | [diff] [blame] | 253 | } |
| 254 | |
Daco Harkes | 550d580 | 2020-12-10 12:15:17 | [diff] [blame] | 255 | dart_fuchsia_test_package("fuchsia_test_package") { |
| 256 | package_name = "dart_test" |
Liam Appelbe | f66eb72 | 2020-07-21 19:40:15 | [diff] [blame] | 257 | deps = [ ":fuchsia_test_component" ] |
Liam Appelbe | 089d6fc | 2020-07-10 18:10:05 | [diff] [blame] | 258 | } |
Daco Harkes | 550d580 | 2020-12-10 12:15:17 | [diff] [blame] | 259 | |
| 260 | dart_fuchsia_test_component("fuchsia_ffi_test_component") { |
Ryan Macnak | 384394b | 2023-02-09 22:43:36 | [diff] [blame] | 261 | manifest = "build/fuchsia/fuchsia_ffi_test_component.cmx" |
Daco Harkes | 550d580 | 2020-12-10 12:15:17 | [diff] [blame] | 262 | data_deps = [ |
| 263 | "runtime/bin:ffi_test_dynamic_library", |
| 264 | "runtime/bin:ffi_test_functions", |
| 265 | ] |
| 266 | library_files = [ |
| 267 | "libffi_test_dynamic_library.so", |
| 268 | "libffi_test_functions.so", |
| 269 | ] |
| 270 | resource_dirs = [ |
| 271 | "pkg/expect", |
| 272 | "pkg/meta", |
| 273 | "tests/ffi", |
| 274 | "third_party/pkg/ffi", |
| 275 | ] |
| 276 | } |
| 277 | |
| 278 | dart_fuchsia_test_package("fuchsia_ffi_test_package") { |
| 279 | package_name = "dart_ffi_test" |
| 280 | deps = [ ":fuchsia_ffi_test_component" ] |
| 281 | } |
Liam Appelbe | 089d6fc | 2020-07-10 18:10:05 | [diff] [blame] | 282 | } |