| 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", |
| Nicholas Shahan | 3a65ac9 | 2023-08-29 21:33:48 | [diff] [blame] | 30 | ":ddc", |
| Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 31 | ":runtime", |
| Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 32 | ] |
| Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 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)", |
| Liam Appelbe | baaf5e1 | 2023-09-28 22:41:42 | [diff] [blame] | 51 | "samples/ffi/http:fake_http", |
| Derek Xu | 7f82667 | 2023-08-25 16:02:28 | [diff] [blame] | 52 | "utils/dartdev:dartdev", |
| Ryan Macnak | 9eb216a | 2017-01-31 17:47:51 | [diff] [blame] | 53 | "utils/kernel-service:kernel-service", |
| Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 54 | ] |
| Ben Konyi | 48aa020 | 2020-05-05 22:27:09 | [diff] [blame] | 55 | |
| Chris Evans | 0b8ab17 | 2023-01-24 14:07:26 | [diff] [blame] | 56 | # This flag is set in runtime/runtime_args.gni |
| 57 | # The analyze_snapshot tool is only supported on 64 bit AOT builds running |
| 58 | # under linux and android platforms |
| 59 | if (build_analyze_snapshot) { |
| Martin Kustermann | b15da0b | 2023-01-27 12:44:30 | [diff] [blame] | 60 | deps += [ |
| 61 | # The `analyze_snapshot` tests require the `analyze_snapshot` as well as |
| 62 | # `gen_snapshot` binaries. |
| 63 | "runtime/bin:analyze_snapshot", |
| 64 | "runtime/bin:analyze_snapshot($host_toolchain)", |
| 65 | "runtime/bin:gen_snapshot", |
| 66 | "runtime/bin:gen_snapshot($host_toolchain)", |
| 67 | ] |
| Chris Evans | 23b1f38 | 2022-03-09 14:17:44 | [diff] [blame] | 68 | } |
| 69 | |
| Zach Anderson | 5dc1f8d | 2021-05-27 21:50:24 | [diff] [blame] | 70 | if (is_linux || is_android) { |
| 71 | deps += [ "runtime/bin:abstract_socket_test" ] |
| Ryan Macnak | 573fad4 | 2023-10-31 17:11:51 | [diff] [blame] | 72 | } else if (is_fuchsia) { |
| 73 | deps += [ ":fuchsia_test_package" ] |
| Zach Anderson | 5dc1f8d | 2021-05-27 21:50:24 | [diff] [blame] | 74 | } |
| Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 75 | } |
| 76 | |
| Daco Harkes | 9f96aed | 2020-11-16 16:10:55 | [diff] [blame] | 77 | # A separate target and not included in group("runtime"). This way the target\ |
| 78 | # "runtime" does not get many executables extra as build output. |
| 79 | group("run_ffi_unit_tests") { |
| 80 | deps = [ "runtime/bin/ffi_unit_test:run_ffi_unit_tests" ] |
| 81 | } |
| 82 | |
| Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 83 | group("runtime_precompiled") { |
| 84 | deps = [ |
| Zachary Anderson | c1313a5 | 2016-10-26 15:50:54 | [diff] [blame] | 85 | "runtime/bin:dart_precompiled_runtime", |
| Florian Schneider | c7aba7d | 2017-01-10 00:58:09 | [diff] [blame] | 86 | "runtime/bin:process_test", |
| Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 87 | ] |
| Zach Anderson | 5dc1f8d | 2021-05-27 21:50:24 | [diff] [blame] | 88 | if (is_linux || is_android) { |
| 89 | deps += [ "runtime/bin:abstract_socket_test" ] |
| 90 | } |
| Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 91 | } |
| 92 | |
| Leaf Petersen | d44457f | 2020-06-16 23:37:36 | [diff] [blame] | 93 | group("create_sdk") { |
| 94 | public_deps = [ "sdk:create_sdk" ] |
| Robert Nystrom | 6d86779 | 2019-09-25 00:43:13 | [diff] [blame] | 95 | } |
| 96 | |
| Leaf Petersen | d44457f | 2020-06-16 23:37:36 | [diff] [blame] | 97 | group("create_platform_sdk") { |
| 98 | public_deps = [ "sdk:create_platform_sdk" ] |
| Ben Konyi | 1960d21 | 2020-05-12 23:37:19 | [diff] [blame] | 99 | } |
| 100 | |
| Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 101 | group("dart2js") { |
| asiva | e33d023 | 2020-03-10 21:56:11 | [diff] [blame] | 102 | deps = [ "utils/compiler:dart2js" ] |
| Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 103 | } |
| 104 | |
| Joshua Litt | fd39eab | 2022-10-05 11:55:22 | [diff] [blame] | 105 | group("dart2wasm_platform") { |
| Aske Simon Christensen | 6c76042 | 2022-05-10 10:06:06 | [diff] [blame] | 106 | deps = [ |
| 107 | ":runtime_precompiled", |
| Joshua Litt | 9e37c2b | 2023-07-18 19:34:38 | [diff] [blame] | 108 | "utils/dart2wasm:compile_dart2wasm_js_compatibility_platform", |
| Aske Simon Christensen | 6c76042 | 2022-05-10 10:06:06 | [diff] [blame] | 109 | "utils/dart2wasm:compile_dart2wasm_platform", |
| Aske Simon Christensen | 6c76042 | 2022-05-10 10:06:06 | [diff] [blame] | 110 | "utils/dart2wasm:dart2wasm_snapshot", |
| Joshua Litt | fd39eab | 2022-10-05 11:55:22 | [diff] [blame] | 111 | ] |
| Joshua Litt | 1ed2a07 | 2022-10-26 17:04:17 | [diff] [blame] | 112 | if (defined(is_product)) { |
| 113 | if (is_product) { |
| 114 | deps += [ "utils/dart2wasm:dart2wasm_product_snapshot" ] |
| 115 | } else { |
| 116 | deps += [ "utils/dart2wasm:dart2wasm_asserts_snapshot" ] |
| 117 | } |
| Ryan Macnak | 8d60495 | 2022-10-10 19:14:58 | [diff] [blame] | 118 | } |
| Joshua Litt | fd39eab | 2022-10-05 11:55:22 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | group("dart2wasm") { |
| 122 | deps = [ |
| 123 | ":dart2wasm_platform", |
| Ömer Sinan Ağacan | affc339 | 2022-09-23 09:41:22 | [diff] [blame] | 124 | "utils/dart2wasm:test_wasm_modules", |
| Aske Simon Christensen | 6c76042 | 2022-05-10 10:06:06 | [diff] [blame] | 125 | ] |
| 126 | } |
| 127 | |
| Martin Kustermann | 0fdeaee | 2022-11-18 10:58:54 | [diff] [blame] | 128 | group("dart2wasm_benchmark") { |
| 129 | deps = [ |
| 130 | ":dart2wasm_platform", |
| 131 | "third_party/binaryen:wasm-opt", |
| 132 | ] |
| 133 | } |
| 134 | |
| Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 135 | group("dartanalyzer") { |
| asiva | e33d023 | 2020-03-10 21:56:11 | [diff] [blame] | 136 | deps = [ "utils/dartanalyzer" ] |
| Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 137 | } |
| 138 | |
| Nicholas Shahan | f4e9496 | 2023-07-25 00:19:52 | [diff] [blame] | 139 | group("ddc") { |
| Nicholas Shahan | 3a65ac9 | 2023-08-29 21:33:48 | [diff] [blame] | 140 | deps = [ "utils/ddc:dartdevc" ] |
| Nicholas Shahan | f4e9496 | 2023-07-25 00:19:52 | [diff] [blame] | 141 | } |
| 142 | |
| Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 143 | group("analysis_server") { |
| asiva | e33d023 | 2020-03-10 21:56:11 | [diff] [blame] | 144 | deps = [ "utils/analysis_server" ] |
| 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 | # This is the target that is built on the dart2js build bots. |
| 148 | # It must depend on anything that is required by the dart2js |
| 149 | # test suites. |
| 150 | group("dart2js_bot") { |
| asiva | e33d023 | 2020-03-10 21:56:11 | [diff] [blame] | 151 | deps = [ ":create_sdk" ] |
| Zachary Anderson | 7c784ce | 2016-09-29 20:23:00 | [diff] [blame] | 152 | } |
| 153 | |
| Zach Anderson | 9847c06 | 2018-06-04 21:35:39 | [diff] [blame] | 154 | # This rule and the compressed_observatory_archive rule are for the Fuchsia |
| 155 | # bots that pre-build the Observatory. They copy the observatory tar files to |
| 156 | # the root build output directory for convenient access by the Fuchsia buildbot |
| 157 | # scripts. |
| Zach Anderson | 736ddd9 | 2018-05-29 16:35:34 | [diff] [blame] | 158 | group("observatory_archive") { |
| asiva | e33d023 | 2020-03-10 21:56:11 | [diff] [blame] | 159 | deps = [ "runtime/observatory:copy_observatory_archive" ] |
| Zach Anderson | 9847c06 | 2018-06-04 21:35:39 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | group("compressed_observatory_archive") { |
| asiva | e33d023 | 2020-03-10 21:56:11 | [diff] [blame] | 163 | deps = [ "runtime/observatory:copy_compressed_observatory_archive" ] |
| Zach Anderson | 736ddd9 | 2018-05-29 16:35:34 | [diff] [blame] | 164 | } |
| Liam Appelbe | 089d6fc | 2020-07-10 18:10:05 | [diff] [blame] | 165 | |
| 166 | if (is_fuchsia) { |
| Zijie He | 690b2ef | 2023-11-13 21:24:08 | [diff] [blame] | 167 | import("third_party/fuchsia/gn-sdk/src/component.gni") |
| 168 | import("third_party/fuchsia/gn-sdk/src/package.gni") |
| Liam Appelbe | 089d6fc | 2020-07-10 18:10:05 | [diff] [blame] | 169 | |
| Ryan Macnak | 573fad4 | 2023-10-31 17:11:51 | [diff] [blame] | 170 | test_binaries = [ |
| 171 | "dart", |
| 172 | "dart_precompiled_runtime", |
| 173 | "run_vm_tests", |
| 174 | ] |
| Liam Appelbe | 6fc75e6 | 2020-07-15 20:44:06 | [diff] [blame] | 175 | |
| Ryan Macnak | 573fad4 | 2023-10-31 17:11:51 | [diff] [blame] | 176 | foreach(binary, test_binaries) { |
| 177 | fuchsia_component("${binary}_test_component") { |
| Daco Harkes | 550d580 | 2020-12-10 12:15:17 | [diff] [blame] | 178 | testonly = true |
| Ryan Macnak | 573fad4 | 2023-10-31 17:11:51 | [diff] [blame] | 179 | manifest = "runtime/bin/${binary}_test_component.cml" |
| 180 | data_deps = [ |
| 181 | "runtime/bin:${binary}", |
| 182 | "runtime/bin:ffi_test_dynamic_library", |
| 183 | "runtime/bin:ffi_test_functions", |
| 184 | ] |
| 185 | library_files = [ |
| 186 | "libffi_test_dynamic_library.so", |
| 187 | "libffi_test_functions.so", |
| 188 | ] |
| Daco Harkes | 550d580 | 2020-12-10 12:15:17 | [diff] [blame] | 189 | resource_files = [ |
| 190 | ".dart_tool/package_config.json", |
| 191 | "pkg/testing/test/hello_test.dart", |
| 192 | "tools/addlatexhash.dart", |
| 193 | ] |
| Ryan Macnak | 573fad4 | 2023-10-31 17:11:51 | [diff] [blame] | 194 | resource_dirs = [ |
| 195 | "pkg/async_helper", |
| 196 | "pkg/expect", |
| 197 | "pkg/meta", |
| 198 | "tests/ffi", |
| 199 | "third_party/pkg/ffi", |
| 200 | "third_party/pkg/path", |
| 201 | ] |
| Daco Harkes | 550d580 | 2020-12-10 12:15:17 | [diff] [blame] | 202 | resources = [] |
| 203 | foreach(file, library_files) { |
| 204 | resources += [ |
| 205 | { |
| 206 | path = root_out_dir + "/" + file |
| 207 | dest = "lib/" + file |
| 208 | }, |
| 209 | ] |
| 210 | } |
| 211 | foreach(file, resource_files) { |
| 212 | resources += [ |
| 213 | { |
| 214 | path = file |
| 215 | dest = "data/" + file |
| 216 | }, |
| 217 | ] |
| 218 | } |
| 219 | resources += |
| 220 | exec_script("tools/fuchsia/find_resources.py", resource_dirs, "json") |
| 221 | } |
| 222 | } |
| 223 | |
| Ryan Macnak | 573fad4 | 2023-10-31 17:11:51 | [diff] [blame] | 224 | fuchsia_package("fuchsia_test_package") { |
| 225 | testonly = true |
| 226 | if (is_debug) { |
| 227 | package_name = "dart_test_debug" |
| 228 | } else if (is_release) { |
| 229 | package_name = "dart_test_release" |
| 230 | } else if (is_product) { |
| 231 | package_name = "dart_test_product" |
| 232 | } |
| 233 | deps = [] |
| 234 | foreach(binary, test_binaries) { |
| 235 | deps += [ ":${binary}_test_component" ] |
| 236 | } |
| Daco Harkes | 550d580 | 2020-12-10 12:15:17 | [diff] [blame] | 237 | } |
| Liam Appelbe | 089d6fc | 2020-07-10 18:10:05 | [diff] [blame] | 238 | } |