OLD | NEW |
1 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 # for details. All rights reserved. Use of this source code is governed by a | 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. | 3 # BSD-style license that can be 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("gypi_contents.gni") | |
8 | 7 |
9 config("libdart_vm_config") { | 8 config("libdart_vm_config") { |
10 if (defined(is_fuchsia) && is_fuchsia) { | 9 if (defined(is_fuchsia) && is_fuchsia) { |
11 libs = [ "magenta" ] | 10 libs = [ "magenta" ] |
12 } else if (is_win) { | 11 } else if (is_win) { |
13 libs = [ | 12 libs = [ |
14 "advapi32.lib", | 13 "advapi32.lib", |
15 "shell32.lib", | 14 "shell32.lib", |
16 "dbghelp.lib", | 15 "dbghelp.lib", |
17 ] | 16 ] |
18 } else { | 17 } else { |
19 libs = [ "dl" ] | 18 libs = [ "dl" ] |
20 if (!is_android) { | 19 if (!is_android) { |
21 libs += [ "pthread" ] | 20 libs += [ "pthread" ] |
22 } | 21 } |
23 if (is_linux) { | 22 if (is_linux) { |
24 libs += [ "rt" ] | 23 libs += [ "rt" ] |
25 } | 24 } |
26 } | 25 } |
27 } | 26 } |
28 | 27 |
29 static_library("libdart_platform") { | 28 static_library("libdart_platform") { |
30 configs += [ | 29 configs += [ |
31 "..:dart_config", | 30 "..:dart_config", |
32 "..:dart_maybe_product_config", | 31 "..:dart_maybe_product_config", |
33 ] | 32 ] |
34 public_configs = [ ":libdart_vm_config" ] | 33 public_configs = [ ":libdart_vm_config" ] |
35 | 34 |
36 sources = rebase_path(processed_gypis.platform_sources, ".", "../platform") | 35 platform_headers_gypi = |
| 36 exec_script("../../tools/gypi_to_gn.py", |
| 37 [ rebase_path("../platform/platform_headers.gypi") ], |
| 38 "scope", |
| 39 [ "../platform/platform_headers.gypi" ]) |
| 40 platform_headers = |
| 41 rebase_path(platform_headers_gypi.sources, ".", "../platform") |
37 | 42 |
| 43 platform_sources_gypi = |
| 44 exec_script("../../tools/gypi_to_gn.py", |
| 45 [ rebase_path("../platform/platform_sources.gypi") ], |
| 46 "scope", |
| 47 [ "../platform/platform_sources.gypi" ]) |
| 48 platform_sources = |
| 49 rebase_path(platform_sources_gypi.sources, ".", "../platform") |
| 50 |
| 51 sources = platform_headers + platform_sources |
38 include_dirs = [ ".." ] | 52 include_dirs = [ ".." ] |
39 } | 53 } |
40 | 54 |
41 vm_sources_list = processed_gypis.vm_sources | 55 vm_sources_list = exec_script("../../tools/gypi_to_gn.py", |
| 56 [ rebase_path("vm_sources.gypi") ], |
| 57 "scope", |
| 58 [ "vm_sources.gypi" ]) |
42 | 59 |
43 static_library("libdart_vm") { | 60 static_library("libdart_vm") { |
44 configs += [ | 61 configs += [ |
45 "..:dart_config", | 62 "..:dart_config", |
46 "..:dart_maybe_product_config", | 63 "..:dart_maybe_product_config", |
47 "..:dart_maybe_precompiled_runtime_config", | 64 "..:dart_maybe_precompiled_runtime_config", |
48 ] | 65 ] |
49 public_configs = [ ":libdart_vm_config" ] | 66 public_configs = [ ":libdart_vm_config" ] |
50 set_sources_assignment_filter([ | 67 set_sources_assignment_filter([ |
51 "*_test.cc", | 68 "*_test.cc", |
52 "*_test.h", | 69 "*_test.h", |
53 ]) | 70 ]) |
54 sources = vm_sources_list | 71 sources = vm_sources_list.sources |
55 include_dirs = [ ".." ] | 72 include_dirs = [ ".." ] |
56 } | 73 } |
57 | 74 |
58 static_library("libdart_vm_noopt") { | 75 static_library("libdart_vm_noopt") { |
59 configs += [ | 76 configs += [ |
60 "..:dart_config", | 77 "..:dart_config", |
61 "..:dart_maybe_product_config", | 78 "..:dart_maybe_product_config", |
62 "..:dart_precompiler_config", | 79 "..:dart_precompiler_config", |
63 "..:dart_maybe_precompiled_runtime_config", | 80 "..:dart_maybe_precompiled_runtime_config", |
64 ] | 81 ] |
65 public_configs = [ ":libdart_vm_config" ] | 82 public_configs = [ ":libdart_vm_config" ] |
66 set_sources_assignment_filter([ | 83 set_sources_assignment_filter([ |
67 "*_test.cc", | 84 "*_test.cc", |
68 "*_test.h", | 85 "*_test.h", |
69 ]) | 86 ]) |
70 sources = vm_sources_list | 87 sources = vm_sources_list.sources |
71 include_dirs = [ ".." ] | 88 include_dirs = [ ".." ] |
72 } | 89 } |
73 | 90 |
74 static_library("libdart_vm_precompiled_runtime") { | 91 static_library("libdart_vm_precompiled_runtime") { |
75 configs += [ | 92 configs += [ |
76 "..:dart_config", | 93 "..:dart_config", |
77 "..:dart_maybe_product_config", | 94 "..:dart_maybe_product_config", |
78 "..:dart_precompiled_runtime_config", | 95 "..:dart_precompiled_runtime_config", |
79 ] | 96 ] |
80 public_configs = [ ":libdart_vm_config" ] | 97 public_configs = [ ":libdart_vm_config" ] |
81 set_sources_assignment_filter([ | 98 set_sources_assignment_filter([ |
82 "*_test.cc", | 99 "*_test.cc", |
83 "*_test.h", | 100 "*_test.h", |
84 ]) | 101 ]) |
85 sources = vm_sources_list | 102 sources = vm_sources_list.sources |
86 include_dirs = [ ".." ] | 103 include_dirs = [ ".." ] |
87 } | 104 } |
88 | 105 |
89 static_library("libdart_vm_nosnapshot") { | 106 static_library("libdart_vm_nosnapshot") { |
90 configs += [ | 107 configs += [ |
91 "..:dart_config", | 108 "..:dart_config", |
92 "..:dart_maybe_product_config", | 109 "..:dart_maybe_product_config", |
93 "..:dart_maybe_precompiled_runtime_config", | 110 "..:dart_maybe_precompiled_runtime_config", |
94 "..:dart_no_snapshot_config", | 111 "..:dart_no_snapshot_config", |
95 ] | 112 ] |
96 public_configs = [ ":libdart_vm_config" ] | 113 public_configs = [ ":libdart_vm_config" ] |
97 set_sources_assignment_filter([ | 114 set_sources_assignment_filter([ |
98 "*_test.cc", | 115 "*_test.cc", |
99 "*_test.h", | 116 "*_test.h", |
100 ]) | 117 ]) |
101 sources = vm_sources_list | 118 sources = vm_sources_list.sources |
102 include_dirs = [ ".." ] | 119 include_dirs = [ ".." ] |
103 } | 120 } |
104 | 121 |
105 static_library("libdart_vm_nosnapshot_precompiled_runtime") { | 122 static_library("libdart_vm_nosnapshot_precompiled_runtime") { |
106 configs += [ | 123 configs += [ |
107 "..:dart_config", | 124 "..:dart_config", |
108 "..:dart_maybe_product_config", | 125 "..:dart_maybe_product_config", |
109 "..:dart_precompiled_runtime_config", | 126 "..:dart_precompiled_runtime_config", |
110 "..:dart_no_snapshot_config", | 127 "..:dart_no_snapshot_config", |
111 ] | 128 ] |
112 public_configs = [ ":libdart_vm_config" ] | 129 public_configs = [ ":libdart_vm_config" ] |
113 set_sources_assignment_filter([ | 130 set_sources_assignment_filter([ |
114 "*_test.cc", | 131 "*_test.cc", |
115 "*_test.h", | 132 "*_test.h", |
116 ]) | 133 ]) |
117 sources = vm_sources_list | 134 sources = vm_sources_list.sources |
118 include_dirs = [ ".." ] | 135 include_dirs = [ ".." ] |
119 } | 136 } |
120 | 137 |
121 static_library("libdart_vm_nosnapshot_with_precompiler") { | 138 static_library("libdart_vm_nosnapshot_with_precompiler") { |
122 configs += [ | 139 configs += [ |
123 "..:dart_config", | 140 "..:dart_config", |
124 "..:dart_maybe_product_config", | 141 "..:dart_maybe_product_config", |
125 "..:dart_precompiler_config", | 142 "..:dart_precompiler_config", |
126 "..:dart_no_snapshot_config", | 143 "..:dart_no_snapshot_config", |
127 ] | 144 ] |
128 public_configs = [ ":libdart_vm_config" ] | 145 public_configs = [ ":libdart_vm_config" ] |
129 set_sources_assignment_filter([ | 146 set_sources_assignment_filter([ |
130 "*_test.cc", | 147 "*_test.cc", |
131 "*_test.h", | 148 "*_test.h", |
132 ]) | 149 ]) |
133 sources = vm_sources_list | 150 sources = vm_sources_list.sources |
134 include_dirs = [ ".." ] | 151 include_dirs = [ ".." ] |
135 } | 152 } |
136 | 153 |
137 template("process_library_source") { | 154 template("process_library_source") { |
138 assert(defined(invoker.libsources), "Need libsources in $target_name") | 155 assert(defined(invoker.filename), "Need filename in $target_name") |
139 assert(defined(invoker.output), "Need output in $target_name") | 156 assert(defined(invoker.output), "Need output in $target_name") |
| 157 assert(defined(invoker.path), "Need path in $target_name") |
140 action(target_name) { | 158 action(target_name) { |
141 visibility = [ ":*" ] # Only targets in this file can see this. | 159 visibility = [ ":*" ] # Only targets in this file can see this. |
142 libsources = invoker.libsources | 160 filename = invoker.filename |
| 161 path = invoker.path |
| 162 |
| 163 lib_sources_gypi = |
| 164 exec_script("../../tools/gypi_to_gn.py", |
| 165 [ rebase_path("${path}/${filename}_sources.gypi") ], |
| 166 "scope", |
| 167 [ "${path}/${filename}_sources.gypi" ]) |
| 168 lib_sources = rebase_path(lib_sources_gypi.sources, ".", path) |
143 | 169 |
144 script = invoker.script | 170 script = invoker.script |
145 inputs = invoker.inputs + libsources | 171 inputs = invoker.inputs + [ script ] |
| 172 inputs += lib_sources |
146 outputs = [ | 173 outputs = [ |
147 invoker.output, | 174 invoker.output, |
148 ] | 175 ] |
149 args = invoker.args + rebase_path(libsources, root_build_dir) | 176 args = invoker.args + rebase_path(lib_sources, root_build_dir) |
150 } | 177 } |
151 } | 178 } |
152 | 179 |
153 template("generate_library_source") { | 180 template("generate_library_source") { |
154 assert(defined(invoker.libname), "Need libname in $target_name") | 181 assert(defined(invoker.libname), "Need libname in $target_name") |
155 assert(defined(invoker.libsources), "Need libsources in $target_name") | 182 assert(defined(invoker.filename), "Need a filename in $target_name") |
156 assert(defined(invoker.kind), "Need kind in $target_name") | 183 assert(defined(invoker.kind), "Need kind in $target_name") |
157 assert(defined(invoker.output), "Need output in $target_name") | 184 assert(defined(invoker.output), "Need output in $target_name") |
| 185 assert(defined(invoker.path), "Need path in $target_name") |
158 | 186 |
159 process_library_source(target_name) { | 187 process_library_source(target_name) { |
160 libname = invoker.libname | 188 libname = invoker.libname |
161 libsources = invoker.libsources | 189 filename = invoker.filename |
162 kind = invoker.kind | 190 kind = invoker.kind |
| 191 output = invoker.output |
| 192 path = invoker.path |
163 script = "../tools/gen_library_src_paths.py" | 193 script = "../tools/gen_library_src_paths.py" |
164 inputs = [ | 194 inputs = [ |
165 "../lib/libgen_in.cc", | 195 "../lib/libgen_in.cc", |
166 ] | 196 ] |
167 output = invoker.output | |
168 args = [ | 197 args = [ |
169 "--output", | 198 "--output", |
170 rebase_path(invoker.output, root_build_dir), | 199 rebase_path(invoker.output, root_build_dir), |
171 "--input_cc", | 200 "--input_cc", |
172 rebase_path("../lib/libgen_in.cc", root_build_dir), | 201 rebase_path("../lib/libgen_in.cc", root_build_dir), |
173 "--include", | 202 "--include", |
174 "vm/bootstrap.h", | 203 "vm/bootstrap.h", |
175 "--var_name", | 204 "--var_name", |
176 "dart::Bootstrap::${libname}_${kind}_paths_", | 205 "dart::Bootstrap::${libname}_${kind}_paths_", |
177 "--library_name", | 206 "--library_name", |
178 "dart:${libname}", | 207 "dart:${libname}", |
179 ] | 208 ] |
180 } | 209 } |
181 } | 210 } |
182 | 211 |
183 # This templates expects invoker.sources to be a list of lists. | 212 # This templates expects invoker.sources to be a list of pairs of strings. |
184 # The lists contain the following information about each library: | 213 # The pairs of strings mean the following. |
185 # library name (string) | 214 # library name, file name |
186 # library sources (list of strings) | 215 # e.g. for the "internal" library named "dart:_internal", |
187 # library source base path (string) | 216 # with sources listed at sdk/lib/internal/internal_sources.gypi and |
188 # filename (string) | 217 # lib/internal_sources.gypi, we have: ["_internal", "internal"] |
189 # do_patch (boolean) | |
190 # | |
191 # If do_patch is true, the lists additionally contains | |
192 # patch sources (list of strings) | |
193 # patch source base path (string) | |
194 # | 218 # |
195 # The template iterates over the list, and generates generate_library_source | 219 # The template iterates over the list, and generates generate_library_source |
196 # actions for each. After that, it generates targets to compile the generated | 220 # actions for each. After that, it generates targets to compile the generated |
197 # sources to make libdart_lib_*. | 221 # sources to make libdart_lib_nosnapshot and libdart_lib. |
198 template("generate_core_libraries") { | 222 template("generate_core_libraries") { |
199 assert(defined(invoker.sources), "Need sources in $target_name") | 223 assert(defined(invoker.sources), "Need sources in $target_name") |
200 assert(defined(invoker.allsources), "Need allsources in $target_name") | |
201 liboutputs = [] | 224 liboutputs = [] |
| 225 libsources = [] |
202 libdeps = [] | 226 libdeps = [] |
203 foreach(lib, invoker.sources) { | 227 foreach(lib, invoker.sources) { |
204 libname = lib[0] | 228 libname = lib[0] |
205 filename = lib[3] | 229 filename = lib[1] |
206 do_patch = lib[4] | 230 do_patch = lib[2] |
| 231 source_path = lib[3] |
207 generate_library_source("generate_${filename}_cc_file") { | 232 generate_library_source("generate_${filename}_cc_file") { |
208 libname = libname | 233 libname = libname |
209 libsources = rebase_path(lib[1], ".", lib[2]) | 234 filename = filename |
210 kind = "source" | 235 kind = "source" |
| 236 path = source_path |
211 output = "$target_gen_dir/${filename}_gen.cc" | 237 output = "$target_gen_dir/${filename}_gen.cc" |
212 } | 238 } |
213 if (do_patch) { | 239 if (do_patch) { |
| 240 patch_path = lib[4] |
214 generate_library_source("generate_${filename}_patch_cc_file") { | 241 generate_library_source("generate_${filename}_patch_cc_file") { |
215 libname = libname | 242 libname = libname |
216 libsources = rebase_path(lib[5], ".", lib[6]) | 243 filename = filename |
217 kind = "patch" | 244 kind = "patch" |
| 245 path = patch_path |
218 output = "$target_gen_dir/${filename}_patch_gen.cc" | 246 output = "$target_gen_dir/${filename}_patch_gen.cc" |
219 } | 247 } |
220 } | 248 } |
221 | 249 lib_sources_gypi = { |
| 250 } |
| 251 lib_sources_gypi = |
| 252 exec_script("../../tools/gypi_to_gn.py", |
| 253 [ rebase_path("../lib/${filename}_sources.gypi") ], |
| 254 "scope", |
| 255 [ "../lib/${filename}_sources.gypi" ]) |
| 256 libsources += rebase_path(lib_sources_gypi.sources, ".", "../lib") |
222 liboutputs += [ "$target_gen_dir/${filename}_gen.cc" ] | 257 liboutputs += [ "$target_gen_dir/${filename}_gen.cc" ] |
223 libdeps += [ ":generate_${filename}_cc_file" ] | 258 libdeps += [ ":generate_${filename}_cc_file" ] |
224 if (do_patch) { | 259 if (do_patch) { |
225 liboutputs += [ "$target_gen_dir/${filename}_patch_gen.cc" ] | 260 liboutputs += [ "$target_gen_dir/${filename}_patch_gen.cc" ] |
226 libdeps += [ ":generate_${filename}_patch_cc_file" ] | 261 libdeps += [ ":generate_${filename}_patch_cc_file" ] |
227 } | 262 } |
228 } | 263 } |
229 | 264 |
230 all_libsources = rebase_path(invoker.allsources, ".", "../lib") | |
231 | |
232 static_library("libdart_lib_nosnapshot") { | 265 static_library("libdart_lib_nosnapshot") { |
233 configs += [ | 266 configs += [ |
234 "..:dart_config", | 267 "..:dart_config", |
235 "..:dart_maybe_product_config", | 268 "..:dart_maybe_product_config", |
236 "..:dart_maybe_precompiled_runtime_config", | 269 "..:dart_maybe_precompiled_runtime_config", |
237 ] | 270 ] |
238 deps = libdeps | 271 deps = libdeps |
239 sources = all_libsources + [ "bootstrap.cc" ] + liboutputs | 272 sources = libsources + [ "bootstrap.cc" ] + liboutputs |
240 include_dirs = [ ".." ] | 273 include_dirs = [ ".." ] |
241 } | 274 } |
242 static_library("libdart_lib_nosnapshot_precompiled_runtime") { | 275 static_library("libdart_lib_nosnapshot_precompiled_runtime") { |
243 configs += [ | 276 configs += [ |
244 "..:dart_config", | 277 "..:dart_config", |
245 "..:dart_maybe_product_config", | 278 "..:dart_maybe_product_config", |
246 "..:dart_precompiled_runtime_config", | 279 "..:dart_precompiled_runtime_config", |
247 ] | 280 ] |
248 deps = libdeps | 281 deps = libdeps |
249 sources = all_libsources + [ "bootstrap.cc" ] + liboutputs | 282 sources = libsources + [ "bootstrap.cc" ] + liboutputs |
250 include_dirs = [ ".." ] | 283 include_dirs = [ ".." ] |
251 } | 284 } |
252 static_library("libdart_lib_nosnapshot_with_precompiler") { | 285 static_library("libdart_lib_nosnapshot_with_precompiler") { |
253 configs += [ | 286 configs += [ |
254 "..:dart_config", | 287 "..:dart_config", |
255 "..:dart_maybe_product_config", | 288 "..:dart_maybe_product_config", |
256 "..:dart_precompiler_config", | 289 "..:dart_precompiler_config", |
257 ] | 290 ] |
258 deps = libdeps | 291 deps = libdeps |
259 sources = all_libsources + [ "bootstrap.cc" ] + liboutputs | 292 sources = libsources + [ "bootstrap.cc" ] + liboutputs |
260 include_dirs = [ ".." ] | 293 include_dirs = [ ".." ] |
261 } | 294 } |
262 static_library("libdart_lib") { | 295 static_library("libdart_lib") { |
263 configs += [ | 296 configs += [ |
264 "..:dart_config", | 297 "..:dart_config", |
265 "..:dart_maybe_product_config", | 298 "..:dart_maybe_product_config", |
266 "..:dart_maybe_precompiled_runtime_config", | 299 "..:dart_maybe_precompiled_runtime_config", |
267 ] | 300 ] |
268 sources = all_libsources + [ "bootstrap_nocore.cc" ] | 301 sources = libsources + [ "bootstrap_nocore.cc" ] |
269 include_dirs = [ ".." ] | 302 include_dirs = [ ".." ] |
270 } | 303 } |
271 static_library("libdart_lib_precompiled_runtime") { | 304 static_library("libdart_lib_precompiled_runtime") { |
272 configs += [ | 305 configs += [ |
273 "..:dart_config", | 306 "..:dart_config", |
274 "..:dart_maybe_product_config", | 307 "..:dart_maybe_product_config", |
275 "..:dart_precompiled_runtime_config", | 308 "..:dart_precompiled_runtime_config", |
276 ] | 309 ] |
277 sources = all_libsources + [ "bootstrap_nocore.cc" ] | 310 sources = libsources + [ "bootstrap_nocore.cc" ] |
278 include_dirs = [ ".." ] | 311 include_dirs = [ ".." ] |
279 } | 312 } |
280 } | 313 } |
281 | 314 |
282 generate_core_libraries("core_libraries") { | 315 generate_core_libraries("core_libraries") { |
283 sources = [ | 316 sources = [ |
284 [ | 317 [ |
285 "async", | 318 "async", |
286 processed_gypis.async_sdk_sources, | |
287 "../../sdk/lib/async", | |
288 "async", | 319 "async", |
289 true, | 320 true, |
290 processed_gypis.async_runtime_sources, | 321 "../../sdk/lib/async", |
291 "../lib", | 322 "../lib", |
292 ], | 323 ], |
293 [ | 324 [ |
294 "core", | 325 "core", |
295 processed_gypis.core_sdk_sources, | |
296 "../../sdk/lib/core", | |
297 "core", | 326 "core", |
298 true, | 327 true, |
299 processed_gypis.core_runtime_sources, | 328 "../../sdk/lib/core", |
300 "../lib", | 329 "../lib", |
301 ], | 330 ], |
302 [ | 331 [ |
303 "collection", | 332 "collection", |
304 processed_gypis.collection_sdk_sources, | |
305 "../../sdk/lib/collection", | |
306 "collection", | 333 "collection", |
307 true, | 334 true, |
308 processed_gypis.collection_runtime_sources, | 335 "../../sdk/lib/collection", |
309 "../lib", | 336 "../lib", |
310 ], | 337 ], |
311 [ | 338 [ |
312 "convert", | 339 "convert", |
313 processed_gypis.convert_sdk_sources, | |
314 "../../sdk/lib/convert", | |
315 "convert", | 340 "convert", |
316 true, | 341 true, |
317 processed_gypis.convert_runtime_sources, | 342 "../../sdk/lib/convert", |
318 "../lib", | 343 "../lib", |
319 ], | 344 ], |
320 [ | 345 [ |
321 "developer", | 346 "developer", |
322 processed_gypis.developer_sdk_sources, | |
323 "../../sdk/lib/developer", | |
324 "developer", | 347 "developer", |
325 true, | 348 true, |
326 processed_gypis.developer_runtime_sources, | 349 "../../sdk/lib/developer", |
327 "../lib", | 350 "../lib", |
328 ], | 351 ], |
329 [ | 352 [ |
330 "_internal", | 353 "_internal", |
331 processed_gypis.internal_sdk_sources, | |
332 "../../sdk/lib/internal", | |
333 "internal", | 354 "internal", |
334 true, | 355 true, |
335 processed_gypis.internal_runtime_sources, | 356 "../../sdk/lib/internal", |
336 "../lib", | 357 "../lib", |
337 ], | 358 ], |
338 [ | 359 [ |
339 "isolate", | 360 "isolate", |
340 processed_gypis.isolate_sdk_sources, | |
341 "../../sdk/lib/isolate", | |
342 "isolate", | 361 "isolate", |
343 true, | 362 true, |
344 processed_gypis.isolate_runtime_sources, | 363 "../../sdk/lib/isolate", |
345 "../lib", | 364 "../lib", |
346 ], | 365 ], |
347 [ | 366 [ |
348 "math", | 367 "math", |
349 processed_gypis.math_sdk_sources, | |
350 "../../sdk/lib/math", | |
351 "math", | 368 "math", |
352 true, | 369 true, |
353 processed_gypis.math_runtime_sources, | 370 "../../sdk/lib/math", |
354 "../lib", | 371 "../lib", |
355 ], | 372 ], |
356 [ | 373 [ |
357 "mirrors", | 374 "mirrors", |
358 processed_gypis.mirrors_sdk_sources, | |
359 "../../sdk/lib/mirrors", | |
360 "mirrors", | 375 "mirrors", |
361 true, | 376 true, |
362 processed_gypis.mirrors_runtime_sources, | 377 "../../sdk/lib/mirrors", |
363 "../lib", | 378 "../lib", |
364 ], | 379 ], |
365 [ | 380 [ |
366 "profiler", | 381 "profiler", |
367 processed_gypis.profiler_sdk_sources, | |
368 "../../sdk/lib/profiler", | |
369 "profiler", | 382 "profiler", |
370 false, | 383 false, |
| 384 "../../sdk/lib/profiler", |
371 ], | 385 ], |
372 [ | 386 [ |
373 "typed_data", | 387 "typed_data", |
374 processed_gypis.typed_data_runtime_sources, | |
375 "../lib", | |
376 "typed_data", | 388 "typed_data", |
377 false, | 389 false, |
| 390 "../lib", |
378 ], | 391 ], |
379 [ | 392 [ |
380 "_vmservice", | 393 "_vmservice", |
381 processed_gypis.vmservice_sdk_sources, | |
382 "../../sdk/lib/vmservice", | |
383 "vmservice", | 394 "vmservice", |
384 true, | 395 true, |
385 processed_gypis.vmservice_runtime_sources, | 396 "../../sdk/lib/vmservice", |
386 "../lib", | 397 "../lib", |
387 ], | 398 ], |
388 ] | 399 ] |
389 allsources = processed_gypis.allsources | |
390 } | 400 } |
391 | 401 |
392 template("concatenate_patch") { | 402 template("concatenate_patch") { |
393 assert(defined(invoker.libsources), "Need a sources in $target_name") | 403 assert(defined(invoker.libname), "Need a name in $target_name") |
| 404 assert(defined(invoker.dir), "Need a dir in $target_name") |
394 assert(defined(invoker.output), "Need an output in $target_name") | 405 assert(defined(invoker.output), "Need an output in $target_name") |
395 | 406 |
396 process_library_source(target_name) { | 407 process_library_source(target_name) { |
397 libsources = invoker.libsources | |
398 inputs = [] | |
399 output = invoker.output | 408 output = invoker.output |
| 409 path = "../${invoker.dir}" |
| 410 filename = invoker.libname |
400 script = "../tools/concatenate_patches.py" | 411 script = "../tools/concatenate_patches.py" |
401 args = [ | 412 args = [ |
402 "--output", | 413 "--output", |
403 rebase_path(output, root_build_dir), | 414 rebase_path(output, root_build_dir), |
404 ] | 415 ] |
| 416 inputs = [] |
405 } | 417 } |
406 } | 418 } |
407 | 419 |
408 if (!defined(is_fuchsia) || !is_fuchsia) { | 420 if (!defined(is_fuchsia) || !is_fuchsia) { |
409 template("generate_patched_sdk") { | 421 template("generate_patched_sdk") { |
410 assert(defined(invoker.libraries), "Need libraries in $target_name") | 422 assert(defined(invoker.libraries), "Need libraries in $target_name") |
411 | 423 |
412 concatenation_target_names = [] | 424 concatenation_target_names = [] |
413 concatenation_files = [] | 425 concatenation_files = [] |
414 | 426 |
415 # Concatenate vm library patches. | 427 # Concatenate vm library patches. |
416 foreach(library, invoker.libraries) { | 428 foreach(library, invoker.libraries) { |
417 name = library[0] | 429 name = library[1] |
418 | 430 |
419 target_output = "$target_gen_dir/patches/${name}_patch.dart" | 431 target_output = "$target_gen_dir/patches/${name}_patch.dart" |
420 concatenate_patch("concatenate_${name}_patch") { | 432 concatenate_patch("concatenate_${name}_patch") { |
421 libsources = library[1] | 433 libname = name |
| 434 dir = library[0] |
422 output = target_output | 435 output = target_output |
423 } | 436 } |
424 concatenation_target_names += [ ":concatenate_${name}_patch" ] | 437 concatenation_target_names += [ ":concatenate_${name}_patch" ] |
425 concatenation_files += [ target_output ] | 438 concatenation_files += [ target_output ] |
426 } | 439 } |
427 | 440 |
428 # Build the patched sdk out of the concatenated patches and the special | 441 # Build the patched sdk out of the concatenated patches and the special |
429 # libraries. | 442 # libraries. |
430 action(target_name) { | 443 action(target_name) { |
431 deps = concatenation_target_names | 444 deps = concatenation_target_names |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 rebase_path("../../sdk"), | 500 rebase_path("../../sdk"), |
488 rebase_path(patches_dir, root_build_dir), | 501 rebase_path(patches_dir, root_build_dir), |
489 rebase_path(patched_sdk_dir, root_build_dir), | 502 rebase_path(patched_sdk_dir, root_build_dir), |
490 ] | 503 ] |
491 } | 504 } |
492 } | 505 } |
493 | 506 |
494 generate_patched_sdk("patched_sdk") { | 507 generate_patched_sdk("patched_sdk") { |
495 libraries = [ | 508 libraries = [ |
496 [ | 509 [ |
| 510 "lib", |
497 "async", | 511 "async", |
498 processed_gypis.async_runtime_sources, | |
499 ], | 512 ], |
500 [ | 513 [ |
| 514 "lib", |
501 "collection", | 515 "collection", |
502 processed_gypis.collection_runtime_sources, | |
503 ], | 516 ], |
504 [ | 517 [ |
| 518 "lib", |
505 "convert", | 519 "convert", |
506 processed_gypis.convert_runtime_sources, | |
507 ], | 520 ], |
508 [ | 521 [ |
| 522 "lib", |
509 "core", | 523 "core", |
510 processed_gypis.core_runtime_sources, | |
511 ], | 524 ], |
512 [ | 525 [ |
| 526 "lib", |
513 "developer", | 527 "developer", |
514 processed_gypis.developer_runtime_sources, | |
515 ], | 528 ], |
516 [ | 529 [ |
| 530 "lib", |
517 "internal", | 531 "internal", |
518 processed_gypis.internal_runtime_sources, | |
519 ], | 532 ], |
520 [ | 533 [ |
| 534 "lib", |
521 "isolate", | 535 "isolate", |
522 processed_gypis.isolate_runtime_sources, | |
523 ], | 536 ], |
524 [ | 537 [ |
| 538 "lib", |
525 "math", | 539 "math", |
526 processed_gypis.math_runtime_sources, | |
527 ], | 540 ], |
528 [ | 541 [ |
| 542 "lib", |
529 "mirrors", | 543 "mirrors", |
530 processed_gypis.mirrors_runtime_sources, | |
531 ], | 544 ], |
532 [ | 545 [ |
| 546 "lib", |
533 "profiler", | 547 "profiler", |
534 processed_gypis.profiler_runtime_sources, | |
535 ], | 548 ], |
536 [ | 549 [ |
| 550 "lib", |
537 "vmservice", | 551 "vmservice", |
538 processed_gypis.vmservice_runtime_sources, | |
539 ], | 552 ], |
540 [ | 553 [ |
| 554 "bin", |
541 "io", | 555 "io", |
542 processed_gypis.bin_io_sources, | |
543 ], | 556 ], |
544 ] | 557 ] |
545 } | 558 } |
546 } | 559 } |
OLD | NEW |