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") | 7 import("gypi_contents.gni") |
8 import("../runtime_args.gni") | 8 import("../runtime_args.gni") |
9 | 9 |
10 config("libdart_vm_config") { | 10 config("libdart_vm_config") { |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 "--output", | 362 "--output", |
363 rebase_path(output, root_build_dir), | 363 rebase_path(output, root_build_dir), |
364 ] | 364 ] |
365 } | 365 } |
366 } | 366 } |
367 | 367 |
368 template("generate_patched_sdk") { | 368 template("generate_patched_sdk") { |
369 assert(defined(invoker.libraries), "Need libraries in $target_name") | 369 assert(defined(invoker.libraries), "Need libraries in $target_name") |
370 | 370 |
371 concatenation_target_names = [] | 371 concatenation_target_names = [] |
372 concatenation_files = [] | |
373 | 372 |
374 # Concatenate vm library patches. | 373 # Concatenate vm library patches. |
375 foreach(library, invoker.libraries) { | 374 foreach(library, invoker.libraries) { |
376 name = library[0] | 375 name = library[0] |
377 | 376 |
378 target_output = "$target_gen_dir/patches/${name}_patch.dart" | 377 target_output = "$target_gen_dir/patches/${name}_patch.dart" |
379 concatenate_patch("concatenate_${name}_patch") { | 378 concatenate_patch("concatenate_${name}_patch") { |
380 libsources = rebase_path(library[1], ".", library[2]) | 379 libsources = rebase_path(library[1], ".", library[2]) |
381 output = target_output | 380 output = target_output |
382 } | 381 } |
383 concatenation_target_names += [ ":concatenate_${name}_patch" ] | 382 concatenation_target_names += [ ":concatenate_${name}_patch" ] |
384 concatenation_files += [ target_output ] | |
385 } | 383 } |
386 | 384 |
387 # Build the patched sdk out of the concatenated patches and the special | 385 # Build the patched sdk out of the concatenated patches and the special |
388 # libraries. | 386 # libraries. |
389 action(target_name) { | 387 action(target_name) { |
390 deps = concatenation_target_names | 388 deps = concatenation_target_names |
391 if (!prebuilt_dart_exe_works) { | 389 if (!prebuilt_dart_exe_works) { |
392 deps += [ "../bin:dart_bootstrap($host_toolchain)" ] | 390 deps += [ "../bin:dart_bootstrap($host_toolchain)" ] |
393 } | 391 } |
394 | 392 |
395 patches_dir = "$target_gen_dir/patches" | 393 patches_dir = "$target_gen_dir/patches" |
396 patched_sdk_dir = "$root_out_dir/patched_sdk" | 394 patched_sdk_dir = "$root_out_dir/patched_sdk" |
397 | 395 |
398 script = "../../tools/patch_sdk.py" | 396 script = "../../tools/patch_sdk.py" |
399 | 397 |
400 # We list all files which make up the sdk (modulo patches) and get them | |
401 # back as a GN list object. | |
402 shared_sdk_sources = exec_script("../../tools/list_dart_files.py", | |
403 [ | |
404 "absolute", | |
405 rebase_path("../../sdk/lib"), | |
406 ], | |
407 "list lines") | |
408 | |
409 front_end_sources = exec_script("../../tools/list_dart_files.py", | |
410 [ | |
411 "absolute", | |
412 rebase_path("../../pkg/front_end"), | |
413 ], | |
414 "list lines") | |
415 | |
416 kernel_sources = exec_script("../../tools/list_dart_files.py", | |
417 [ | |
418 "absolute", | |
419 rebase_path("../../pkg/kernel"), | |
420 ], | |
421 "list lines") | |
422 | |
423 # We list the `patch_sdk.dart` tool here because the [script] (which is | 398 # We list the `patch_sdk.dart` tool here because the [script] (which is |
424 # implicitly an input) will call it. | 399 # implicitly an input) will call it. |
425 inputs = [ | 400 inputs = [ |
426 "../../tools/patch_sdk.dart", | 401 "../../tools/patch_sdk.dart", |
427 ] | 402 ] |
428 | 403 depfile = "$root_out_dir/patched_sdk.d" |
429 # Files below are not patches, they will not be in [concatenation_files] | |
430 # but the `patch_sdk.dart` script will copy them into the patched sdk. | |
431 inputs += [ | |
432 "../bin/builtin.dart", | |
433 "../bin/vmservice/vmservice_io.dart", | |
434 "../bin/vmservice/loader.dart", | |
435 "../bin/vmservice/server.dart", | |
436 ] | |
437 | |
438 # Add all the normal sdk sources. | |
439 inputs += shared_sdk_sources | |
440 | |
441 # Add all the concatenated patch files. | |
442 inputs += concatenation_files | |
443 | |
444 # Add some front-end dependencies | |
445 inputs += front_end_sources | |
446 inputs += kernel_sources | |
447 | 404 |
448 outputs = [ | 405 outputs = [ |
449 # Instead of listing all outputs we list a single well-known one. | 406 # Instead of listing all outputs we list a single well-known one. |
450 "${patched_sdk_dir}/lib/core/core.dart", | 407 "${patched_sdk_dir}/platform.dill", |
451 ] | 408 ] |
452 | 409 |
453 args = [ "--quiet" ] | 410 args = [ "--quiet" ] |
454 if (!prebuilt_dart_exe_works) { | 411 if (!prebuilt_dart_exe_works) { |
455 dart_out_dir = get_label_info("../bin:dart_bootstrap($host_toolchain)", | 412 dart_out_dir = get_label_info("../bin:dart_bootstrap($host_toolchain)", |
456 "root_out_dir") | 413 "root_out_dir") |
457 dart_bootstrap = | 414 dart_bootstrap = |
458 rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix") | 415 rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix") |
459 args += [ | 416 args += [ |
460 "--dart-executable", | 417 "--dart-executable", |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 processed_gypis.vmservice_runtime_sources, | 490 processed_gypis.vmservice_runtime_sources, |
534 "../lib", | 491 "../lib", |
535 ], | 492 ], |
536 [ | 493 [ |
537 "io", | 494 "io", |
538 processed_gypis.bin_io_sources, | 495 processed_gypis.bin_io_sources, |
539 "../bin", | 496 "../bin", |
540 ], | 497 ], |
541 ] | 498 ] |
542 } | 499 } |
OLD | NEW |