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("gypi_contents.gni") | 5 import("gypi_contents.gni") |
6 import("../runtime_args.gni") | 6 import("../runtime_args.gni") |
7 import("../../build/compiled_action.gni") | 7 import("../../build/compiled_action.gni") |
8 | 8 |
9 # Generate a resources.cc file for the service isolate without Observatory. | 9 # Generate a resources.cc file for the service isolate without Observatory. |
10 action("gen_resources_cc") { | 10 action("gen_resources_cc") { |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
482 rebase_path(vm_isolate_snapshot, root_build_dir), | 482 rebase_path(vm_isolate_snapshot, root_build_dir), |
483 "--isolate_output_bin", | 483 "--isolate_output_bin", |
484 rebase_path(isolate_snapshot, root_build_dir), | 484 rebase_path(isolate_snapshot, root_build_dir), |
485 "--target_os", | 485 "--target_os", |
486 current_os, | 486 current_os, |
487 "--timestamp_file", | 487 "--timestamp_file", |
488 rebase_path(gen_snapshot_stamp_file, root_build_dir), | 488 rebase_path(gen_snapshot_stamp_file, root_build_dir), |
489 ] | 489 ] |
490 } | 490 } |
491 | 491 |
492 action("generate_snapshot_file") { | 492 template("bin_to_assembly") { |
zra
2017/05/24 16:20:24
Please add comment describing what this does, and
rmacnak
2017/05/24 19:26:45
Done.
| |
493 action(target_name) { | |
494 deps = invoker.deps | |
zra
2017/05/24 16:20:24
Assert that this is defined.
| |
495 script = "../tools/bin_to_assembly.py" | |
496 args = [ | |
497 "--input", | |
498 rebase_path(invoker.input), | |
zra
2017/05/24 16:20:24
ditto
| |
499 "--output", | |
500 rebase_path(invoker.output), | |
zra
2017/05/24 16:20:24
ditto
| |
501 "--symbol_name", | |
502 invoker.symbol, | |
zra
2017/05/24 16:20:24
ditto
| |
503 "--target_os", | |
504 target_os, | |
505 ] | |
506 if (invoker.executable) { | |
zra
2017/05/24 16:20:24
ditto
| |
507 args += [ "--executable" ] | |
508 } | |
509 inputs = [ | |
510 script, | |
511 invoker.input, | |
512 ] | |
513 outputs = [ | |
514 invoker.output, | |
515 ] | |
516 } | |
517 } | |
518 | |
519 bin_to_assembly("vm_snapshot_data_assembly") { | |
493 deps = [ | 520 deps = [ |
494 ":generate_snapshot_bin", | 521 ":generate_snapshot_bin", |
495 ] | 522 ] |
523 input = "$target_gen_dir/vm_isolate_snapshot.bin" | |
524 output = "$target_gen_dir/vm_snapshot_data.S" | |
525 symbol = "kDartVmSnapshotData" | |
526 executable = false | |
527 } | |
496 | 528 |
497 snapshot_in_cc_file = "snapshot_in.cc" | 529 bin_to_assembly("vm_snapshot_instructions_assembly") { |
498 inputs = [ | 530 deps = [] |
499 "../tools/create_snapshot_file.py", | 531 input = "../tools/empty.bin" |
500 snapshot_in_cc_file, | 532 output = "$target_gen_dir/vm_snapshot_instructions.S" |
501 "$target_gen_dir/vm_isolate_snapshot.bin", | 533 symbol = "kDartVmSnapshotInstructions" |
502 "$target_gen_dir/isolate_snapshot.bin", | 534 executable = true |
535 } | |
536 | |
537 bin_to_assembly("isolate_snapshot_data_assembly") { | |
538 deps = [ | |
539 ":generate_snapshot_bin", | |
503 ] | 540 ] |
504 output = "$root_gen_dir/dart_snapshot.cc" | 541 input = "$target_gen_dir/isolate_snapshot.bin" |
505 outputs = [ | 542 output = "$target_gen_dir/isolate_snapshot_data.S" |
506 output, | 543 symbol = "kDartCoreIsolateSnapshotData" |
544 executable = false | |
545 } | |
546 | |
547 bin_to_assembly("isolate_snapshot_instructions_assembly") { | |
548 deps = [] | |
549 input = "../tools/empty.bin" | |
550 output = "$target_gen_dir/isolate_snapshot_instructions.S" | |
551 symbol = "kDartCoreIsolateSnapshotInstructions" | |
552 executable = true | |
553 } | |
554 | |
555 source_set("dart_snapshot_cc") { | |
556 deps = [ | |
557 ":isolate_snapshot_data_assembly", | |
558 ":isolate_snapshot_instructions_assembly", | |
559 ":vm_snapshot_data_assembly", | |
560 ":vm_snapshot_instructions_assembly", | |
507 ] | 561 ] |
508 | 562 sources = [ |
509 script = "../tools/create_snapshot_file.py" | 563 "$target_gen_dir/isolate_snapshot_data.S", |
510 args = [ | 564 "$target_gen_dir/isolate_snapshot_instructions.S", |
511 "--vm_input_bin", | 565 "$target_gen_dir/vm_snapshot_data.S", |
512 rebase_path("$target_gen_dir/vm_isolate_snapshot.bin"), | 566 "$target_gen_dir/vm_snapshot_instructions.S", |
513 "--input_bin", | |
514 rebase_path("$target_gen_dir/isolate_snapshot.bin"), | |
515 "--input_cc", | |
516 rebase_path(snapshot_in_cc_file), | |
517 "--output", | |
518 rebase_path(output), | |
519 ] | 567 ] |
520 } | 568 } |
521 | 569 |
522 source_set("dart_snapshot_cc") { | |
523 sources = [ | |
524 "$root_gen_dir/dart_snapshot.cc", | |
525 ] | |
526 | |
527 deps = [ | |
528 ":generate_snapshot_file", | |
529 ] | |
530 } | |
531 | |
532 template("dart_executable") { | 570 template("dart_executable") { |
533 extra_configs = [] | 571 extra_configs = [] |
534 if (defined(invoker.extra_configs)) { | 572 if (defined(invoker.extra_configs)) { |
535 extra_configs += invoker.extra_configs | 573 extra_configs += invoker.extra_configs |
536 } | 574 } |
537 extra_deps = [] | 575 extra_deps = [] |
538 if (defined(invoker.extra_deps)) { | 576 if (defined(invoker.extra_deps)) { |
539 extra_deps += invoker.extra_deps | 577 extra_deps += invoker.extra_deps |
540 } | 578 } |
541 extra_defines = [] | 579 extra_defines = [] |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
865 ] | 903 ] |
866 if (is_linux || is_android) { | 904 if (is_linux || is_android) { |
867 cflags = [ "-fPIC" ] | 905 cflags = [ "-fPIC" ] |
868 } | 906 } |
869 if (is_win) { | 907 if (is_win) { |
870 libs = [ "dart.lib" ] | 908 libs = [ "dart.lib" ] |
871 abs_root_out_dir = rebase_path(root_out_dir) | 909 abs_root_out_dir = rebase_path(root_out_dir) |
872 ldflags = [ "/LIBPATH:$abs_root_out_dir" ] | 910 ldflags = [ "/LIBPATH:$abs_root_out_dir" ] |
873 } | 911 } |
874 } | 912 } |
OLD | NEW |