| 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("../../utils/generate_patch_sdk.gni") |
| 7 import("gypi_contents.gni") | 8 import("gypi_contents.gni") |
| 8 import("../runtime_args.gni") | 9 import("../runtime_args.gni") |
| 9 | 10 |
| 10 config("libdart_vm_config") { | 11 config("libdart_vm_config") { |
| 11 if (defined(is_fuchsia) && is_fuchsia) { | 12 if (defined(is_fuchsia) && is_fuchsia) { |
| 12 libs = [ "magenta" ] | 13 libs = [ "magenta" ] |
| 13 } else if (is_win) { | 14 } else if (is_win) { |
| 14 libs = [ | 15 libs = [ |
| 15 "advapi32.lib", | 16 "advapi32.lib", |
| 16 "shell32.lib", | 17 "shell32.lib", |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 inputs = [] | 375 inputs = [] |
| 375 output = invoker.output | 376 output = invoker.output |
| 376 script = "../tools/concatenate_patches.py" | 377 script = "../tools/concatenate_patches.py" |
| 377 args = [ | 378 args = [ |
| 378 "--output", | 379 "--output", |
| 379 rebase_path(output, root_build_dir), | 380 rebase_path(output, root_build_dir), |
| 380 ] | 381 ] |
| 381 } | 382 } |
| 382 } | 383 } |
| 383 | 384 |
| 384 template("generate_patched_sdk") { | 385 template("generate_vm_patched_sdk") { |
| 385 assert(defined(invoker.libraries), "Need libraries in $target_name") | 386 assert(defined(invoker.libraries), "Need libraries in $target_name") |
| 386 | 387 |
| 387 concatenation_target_names = [] | 388 concatenation_target_names = [] |
| 388 | 389 |
| 389 # Concatenate vm library patches. | 390 # Concatenate vm library patches. |
| 390 foreach(library, invoker.libraries) { | 391 foreach(library, invoker.libraries) { |
| 391 name = library[0] | 392 name = library[0] |
| 392 | 393 |
| 393 target_output = "$target_gen_dir/patches/${name}_patch.dart" | 394 target_output = "$target_gen_dir/patches/${name}_patch.dart" |
| 394 concatenate_patch("concatenate_${name}_patch") { | 395 concatenate_patch("concatenate_${name}_patch") { |
| 395 libsources = rebase_path(library[1], ".", library[2]) | 396 libsources = rebase_path(library[1], ".", library[2]) |
| 396 output = target_output | 397 output = target_output |
| 397 } | 398 } |
| 398 concatenation_target_names += [ ":concatenate_${name}_patch" ] | 399 concatenation_target_names += [ ":concatenate_${name}_patch" ] |
| 399 } | 400 } |
| 400 | 401 |
| 401 # Build the patched sdk out of the concatenated patches and the special | 402 # Build the patched sdk out of the concatenated patches and the special |
| 402 # libraries. | 403 # libraries. |
| 403 action(target_name) { | 404 generate_patched_sdk(target_name) { |
| 405 mode = "vm" |
| 404 deps = concatenation_target_names | 406 deps = concatenation_target_names |
| 405 if (!prebuilt_dart_exe_works) { | 407 input_patches_dir = "$target_gen_dir/patches" |
| 406 deps += [ "../bin:dart_bootstrap($host_toolchain)" ] | 408 patched_sdk_dir = "patched_sdk" |
| 407 } | |
| 408 | |
| 409 patches_dir = "$target_gen_dir/patches" | |
| 410 patched_sdk_dir = "$root_out_dir/patched_sdk" | |
| 411 | |
| 412 script = "../../tools/patch_sdk.py" | |
| 413 | |
| 414 # We list the `patch_sdk.dart` tool here because the [script] (which is | |
| 415 # implicitly an input) will call it. | |
| 416 inputs = [ | |
| 417 "../../tools/patch_sdk.dart", | |
| 418 ] | |
| 419 depfile = "$root_out_dir/patched_sdk.d" | |
| 420 | |
| 421 outputs = [ | |
| 422 # Instead of listing all outputs we list a single well-known one. | |
| 423 "${patched_sdk_dir}/platform.dill", | |
| 424 ] | |
| 425 | |
| 426 args = [ "--quiet" ] | |
| 427 if (!prebuilt_dart_exe_works) { | |
| 428 dart_out_dir = get_label_info("../bin:dart_bootstrap($host_toolchain)", | |
| 429 "root_out_dir") | |
| 430 dart_bootstrap = | |
| 431 rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix") | |
| 432 args += [ | |
| 433 "--dart-executable", | |
| 434 dart_bootstrap, | |
| 435 ] | |
| 436 } | |
| 437 args += [ | |
| 438 "vm", | |
| 439 rebase_path("../../sdk"), | |
| 440 rebase_path(patches_dir, root_build_dir), | |
| 441 rebase_path(patched_sdk_dir, root_build_dir), | |
| 442 rebase_path("../../.packages"), | |
| 443 ] | |
| 444 } | 409 } |
| 445 } | 410 } |
| 446 | 411 |
| 447 generate_patched_sdk("patched_sdk") { | 412 generate_vm_patched_sdk("patched_sdk") { |
| 448 libraries = [ | 413 libraries = [ |
| 449 [ | 414 [ |
| 450 "async", | 415 "async", |
| 451 processed_gypis.async_runtime_sources, | 416 processed_gypis.async_runtime_sources, |
| 452 "../lib", | 417 "../lib", |
| 453 ], | 418 ], |
| 454 [ | 419 [ |
| 455 "collection", | 420 "collection", |
| 456 processed_gypis.collection_runtime_sources, | 421 processed_gypis.collection_runtime_sources, |
| 457 "../lib", | 422 "../lib", |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 processed_gypis.vmservice_runtime_sources, | 471 processed_gypis.vmservice_runtime_sources, |
| 507 "../lib", | 472 "../lib", |
| 508 ], | 473 ], |
| 509 [ | 474 [ |
| 510 "io", | 475 "io", |
| 511 processed_gypis.bin_io_sources, | 476 processed_gypis.bin_io_sources, |
| 512 "../bin", | 477 "../bin", |
| 513 ], | 478 ], |
| 514 ] | 479 ] |
| 515 } | 480 } |
| OLD | NEW |