OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("../../build/executable_suffix.gni") | 5 import("../../build/executable_suffix.gni") |
6 import("../../build/prebuilt_dart_sdk.gni") | 6 import("../../build/prebuilt_dart_sdk.gni") |
7 import("../../build/dart_host_toolchain.gni") | 7 import("../../build/dart_host_toolchain.gni") |
8 | 8 |
9 # Currently paths here are hard coded for convenience in building Mojo/Flutter. | |
10 declare_args() { | |
11 # Specify the path to a host compatible version of the Dart SDK. | |
12 # This SDK is used to compile the Observatory frontend sources. | |
13 dart_host_sdk = rebase_path("//third_party/dart-sdk/dart-sdk") | |
14 | |
15 # Specify the path to a host compatible version of pub. | |
16 # This is used to compile the Observatory frontend sources. | |
17 # | |
18 # The observatory build tool searches for pub first using this GN arg, then | |
19 # for the checked-in SDK, and if that doesn't work, it uses the dart_bootstrap | |
20 # built as part of the build to invoke pub. If this arg is set to a non-empty | |
21 # string, we assume that there is no need for dart_bootstrap. If it is set to | |
22 # "", then we assume that there may be a need for dart_bootstrap. | |
23 if (defined(is_win) && is_win) { | |
24 dart_host_pub_exe = rebase_path("$dart_host_sdk/bin/pub.bat") | |
25 } else { | |
26 dart_host_pub_exe = rebase_path("$dart_host_sdk/bin/pub") | |
27 } | |
28 } | |
29 | |
30 # We set this to "" in the Fuchsia build to force building with dart_bootstrap. | |
31 if (is_fuchsia || is_fuchsia_host) { | |
32 dart_host_pub_exe = "" | |
33 } | |
34 | |
35 # Construct arguments to the observatory tool for finding pub. | 9 # Construct arguments to the observatory tool for finding pub. |
36 pub_build_deps = [] | 10 pub_build_deps = [] |
37 pub_build_args = [] | 11 pub_build_args = [] |
38 if (dart_host_pub_exe != "") { | 12 if (!prebuilt_dart_exe_works) { |
39 pub_build_args = [ | |
40 "--pub-executable", | |
41 dart_host_pub_exe, | |
42 ] | |
43 } else if (!prebuilt_dart_exe_works) { | |
44 pub_build_deps += [ "../bin:dart_bootstrap($dart_host_toolchain)" ] | 13 pub_build_deps += [ "../bin:dart_bootstrap($dart_host_toolchain)" ] |
45 | 14 |
46 dart_out_dir = get_label_info("../bin:dart_bootstrap($dart_host_toolchain)", | 15 dart_out_dir = get_label_info("../bin:dart_bootstrap($dart_host_toolchain)", |
47 "root_out_dir") | 16 "root_out_dir") |
48 dart_bootstrap = rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix") | 17 dart_bootstrap = rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix") |
49 | 18 |
50 pub_build_args = [ | 19 pub_build_args = [ |
51 "--sdk=True", | 20 "--sdk=True", |
52 "--dart-executable", | 21 "--dart-executable", |
53 dart_bootstrap, | 22 dart_bootstrap, |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 213 |
245 source_set("standalone_observatory_archive") { | 214 source_set("standalone_observatory_archive") { |
246 deps = [ | 215 deps = [ |
247 ":standalone_archive_observatory", | 216 ":standalone_archive_observatory", |
248 ] | 217 ] |
249 | 218 |
250 sources = [ | 219 sources = [ |
251 rebase_path("$root_gen_dir/observatory/standalone_archive_observatory.cc"), | 220 rebase_path("$root_gen_dir/observatory/standalone_archive_observatory.cc"), |
252 ] | 221 ] |
253 } | 222 } |
OLD | NEW |