Chromium Code Reviews| 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 declare_args() { | |
| 10 # Controls the kind of core snapshot linked into the standalone VM. Using a | |
| 11 # core-jit snapshot breaks the ability to change various flags that affect | |
| 12 # code generation. | |
| 13 core_snapshot_kind = "core" | |
|
zra
2017/05/31 17:10:31
dart_core_snapshot_kind
rmacnak
2017/05/31 19:53:01
Done.
| |
| 14 } | |
| 15 | |
| 9 # Generate a resources.cc file for the service isolate without Observatory. | 16 # Generate a resources.cc file for the service isolate without Observatory. |
| 10 action("gen_resources_cc") { | 17 action("gen_resources_cc") { |
| 11 visibility = [ ":*" ] # Only targets in this file can see this. | 18 visibility = [ ":*" ] # Only targets in this file can see this. |
| 12 script = "../tools/create_resources.py" | 19 script = "../tools/create_resources.py" |
| 13 inputs = [ | 20 inputs = [ |
| 14 "../tools/create_resources.py", | 21 "../tools/create_resources.py", |
| 15 ] | 22 ] |
| 16 | 23 |
| 17 # The path below is hard coded for the Mojo and Flutter trees. When moving | 24 # The path below is hard coded for the Mojo and Flutter trees. When moving |
| 18 # the Dart runtime to gn, this path might need to be updated. | 25 # the Dart runtime to gn, this path might need to be updated. |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 453 | 460 |
| 454 dart_io("standalone_dart_io") { | 461 dart_io("standalone_dart_io") { |
| 455 extra_sources = [] | 462 extra_sources = [] |
| 456 } | 463 } |
| 457 | 464 |
| 458 action("generate_snapshot_bin") { | 465 action("generate_snapshot_bin") { |
| 459 deps = [ | 466 deps = [ |
| 460 "../bin:gen_snapshot($host_toolchain)", | 467 "../bin:gen_snapshot($host_toolchain)", |
| 461 ] | 468 ] |
| 462 | 469 |
| 463 vm_isolate_snapshot = "$target_gen_dir/vm_isolate_snapshot.bin" | 470 vm_snapshot_data = "$target_gen_dir/vm_snapshot_data.bin" |
| 464 isolate_snapshot = "$target_gen_dir/isolate_snapshot.bin" | 471 vm_snapshot_instructions = "$target_gen_dir/vm_snapshot_instructions.bin" |
| 472 isolate_snapshot_data = "$target_gen_dir/isolate_snapshot_data.bin" | |
| 473 isolate_snapshot_instructions = | |
| 474 "$target_gen_dir/isolate_snapshot_instructions.bin" | |
| 465 gen_snapshot_stamp_file = "$target_gen_dir/gen_snapshot.stamp" | 475 gen_snapshot_stamp_file = "$target_gen_dir/gen_snapshot.stamp" |
| 466 outputs = [ | 476 outputs = [ |
| 467 vm_isolate_snapshot, | 477 vm_snapshot_data, |
| 468 isolate_snapshot, | 478 vm_snapshot_instructions, |
| 479 isolate_snapshot_data, | |
| 480 isolate_snapshot_instructions, | |
| 469 gen_snapshot_stamp_file, | 481 gen_snapshot_stamp_file, |
| 470 ] | 482 ] |
| 471 | 483 |
| 472 gen_snapshot_dir = | 484 gen_snapshot_dir = |
| 473 get_label_info("../bin:gen_snapshot($host_toolchain)", "root_out_dir") | 485 get_label_info("../bin:gen_snapshot($host_toolchain)", "root_out_dir") |
| 474 | 486 |
| 475 script = rebase_path("../tools/create_snapshot_bin.py") | 487 script = rebase_path("../tools/create_snapshot_bin.py") |
| 476 args = [ | 488 args = [ |
| 477 "--executable", | 489 "--executable", |
| 478 rebase_path("$gen_snapshot_dir/gen_snapshot"), | 490 rebase_path("$gen_snapshot_dir/gen_snapshot"), |
| 479 "--snapshot_kind", | 491 "--snapshot_kind", |
| 480 "core", | 492 core_snapshot_kind, |
| 481 "--vm_output_bin", | 493 "--vm_output_bin", |
| 482 rebase_path(vm_isolate_snapshot, root_build_dir), | 494 rebase_path(vm_snapshot_data, root_build_dir), |
| 495 "--vm_instructions_output_bin", | |
| 496 rebase_path(vm_snapshot_instructions, root_build_dir), | |
| 483 "--isolate_output_bin", | 497 "--isolate_output_bin", |
| 484 rebase_path(isolate_snapshot, root_build_dir), | 498 rebase_path(isolate_snapshot_data, root_build_dir), |
| 485 "--target_os", | 499 "--isolate_instructions_output_bin", |
| 486 current_os, | 500 rebase_path(isolate_snapshot_instructions, root_build_dir), |
| 487 "--timestamp_file", | 501 "--timestamp_file", |
| 488 rebase_path(gen_snapshot_stamp_file, root_build_dir), | 502 rebase_path(gen_snapshot_stamp_file, root_build_dir), |
| 489 ] | 503 ] |
| 490 } | 504 } |
| 491 | 505 |
| 492 # Generates an assembly file defining a given symbol with the bytes from a | 506 # Generates an assembly file defining a given symbol with the bytes from a |
| 493 # binary file. Places the symbol in a text section if 'executable' is true, | 507 # binary file. Places the symbol in a text section if 'executable' is true, |
| 494 # otherwise places the symbol in a read-only data section. | 508 # otherwise places the symbol in a read-only data section. |
| 495 template("bin_to_assembly") { | 509 template("bin_to_assembly") { |
| 496 assert(defined(invoker.deps), "Must define deps") | 510 assert(defined(invoker.deps), "Must define deps") |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 522 outputs = [ | 536 outputs = [ |
| 523 invoker.output, | 537 invoker.output, |
| 524 ] | 538 ] |
| 525 } | 539 } |
| 526 } | 540 } |
| 527 | 541 |
| 528 bin_to_assembly("vm_snapshot_data_assembly") { | 542 bin_to_assembly("vm_snapshot_data_assembly") { |
| 529 deps = [ | 543 deps = [ |
| 530 ":generate_snapshot_bin", | 544 ":generate_snapshot_bin", |
| 531 ] | 545 ] |
| 532 input = "$target_gen_dir/vm_isolate_snapshot.bin" | 546 input = "$target_gen_dir/vm_snapshot_data.bin" |
| 533 output = "$target_gen_dir/vm_snapshot_data.S" | 547 output = "$target_gen_dir/vm_snapshot_data.S" |
| 534 symbol = "kDartVmSnapshotData" | 548 symbol = "kDartVmSnapshotData" |
| 535 executable = false | 549 executable = false |
| 536 } | 550 } |
| 537 | 551 |
| 538 bin_to_assembly("vm_snapshot_instructions_assembly") { | 552 bin_to_assembly("vm_snapshot_instructions_assembly") { |
| 539 deps = [] | 553 deps = [ |
| 540 input = "../tools/empty.bin" | 554 ":generate_snapshot_bin", |
| 555 ] | |
| 556 input = "$target_gen_dir/vm_snapshot_instructions.bin" | |
| 541 output = "$target_gen_dir/vm_snapshot_instructions.S" | 557 output = "$target_gen_dir/vm_snapshot_instructions.S" |
| 542 symbol = "kDartVmSnapshotInstructions" | 558 symbol = "kDartVmSnapshotInstructions" |
| 543 executable = true | 559 executable = true |
| 544 } | 560 } |
| 545 | 561 |
| 546 bin_to_assembly("isolate_snapshot_data_assembly") { | 562 bin_to_assembly("isolate_snapshot_data_assembly") { |
| 547 deps = [ | 563 deps = [ |
| 548 ":generate_snapshot_bin", | 564 ":generate_snapshot_bin", |
| 549 ] | 565 ] |
| 550 input = "$target_gen_dir/isolate_snapshot.bin" | 566 input = "$target_gen_dir/isolate_snapshot_data.bin" |
| 551 output = "$target_gen_dir/isolate_snapshot_data.S" | 567 output = "$target_gen_dir/isolate_snapshot_data.S" |
| 552 symbol = "kDartCoreIsolateSnapshotData" | 568 symbol = "kDartCoreIsolateSnapshotData" |
| 553 executable = false | 569 executable = false |
| 554 } | 570 } |
| 555 | 571 |
| 556 bin_to_assembly("isolate_snapshot_instructions_assembly") { | 572 bin_to_assembly("isolate_snapshot_instructions_assembly") { |
| 557 deps = [] | 573 deps = [ |
| 558 input = "../tools/empty.bin" | 574 ":generate_snapshot_bin", |
| 575 ] | |
| 576 input = "$target_gen_dir/isolate_snapshot_instructions.bin" | |
| 559 output = "$target_gen_dir/isolate_snapshot_instructions.S" | 577 output = "$target_gen_dir/isolate_snapshot_instructions.S" |
| 560 symbol = "kDartCoreIsolateSnapshotInstructions" | 578 symbol = "kDartCoreIsolateSnapshotInstructions" |
| 561 executable = true | 579 executable = true |
| 562 } | 580 } |
| 563 | 581 |
| 564 source_set("dart_snapshot_cc") { | 582 source_set("dart_snapshot_cc") { |
| 565 deps = [ | 583 deps = [ |
| 566 ":isolate_snapshot_data_assembly", | 584 ":isolate_snapshot_data_assembly", |
| 567 ":isolate_snapshot_instructions_assembly", | 585 ":isolate_snapshot_instructions_assembly", |
| 568 ":vm_snapshot_data_assembly", | 586 ":vm_snapshot_data_assembly", |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 912 ] | 930 ] |
| 913 if (is_linux || is_android) { | 931 if (is_linux || is_android) { |
| 914 cflags = [ "-fPIC" ] | 932 cflags = [ "-fPIC" ] |
| 915 } | 933 } |
| 916 if (is_win) { | 934 if (is_win) { |
| 917 libs = [ "dart.lib" ] | 935 libs = [ "dart.lib" ] |
| 918 abs_root_out_dir = rebase_path(root_out_dir) | 936 abs_root_out_dir = rebase_path(root_out_dir) |
| 919 ldflags = [ "/LIBPATH:$abs_root_out_dir" ] | 937 ldflags = [ "/LIBPATH:$abs_root_out_dir" ] |
| 920 } | 938 } |
| 921 } | 939 } |
| OLD | NEW |