| 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() { | 9 declare_args() { |
| 10 # Controls the kind of core snapshot linked into the standalone VM. Using a | 10 # Controls the kind of core snapshot linked into the standalone VM. Using a |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 "builtin_nolib.cc", | 457 "builtin_nolib.cc", |
| 458 "embedded_dart_io.cc", | 458 "embedded_dart_io.cc", |
| 459 "embedded_dart_io.h", | 459 "embedded_dart_io.h", |
| 460 ] | 460 ] |
| 461 } | 461 } |
| 462 | 462 |
| 463 dart_io("standalone_dart_io") { | 463 dart_io("standalone_dart_io") { |
| 464 extra_sources = [] | 464 extra_sources = [] |
| 465 } | 465 } |
| 466 | 466 |
| 467 action("generate_snapshot_bin") { | 467 compiled_action("generate_snapshot_bin") { |
| 468 deps = [ | 468 compilation_trace = "hello_world_trace.txt" |
| 469 "../bin:gen_snapshot($host_toolchain)", | |
| 470 ] | |
| 471 | |
| 472 vm_snapshot_data = "$target_gen_dir/vm_snapshot_data.bin" | 469 vm_snapshot_data = "$target_gen_dir/vm_snapshot_data.bin" |
| 473 vm_snapshot_instructions = "$target_gen_dir/vm_snapshot_instructions.bin" | 470 vm_snapshot_instructions = "$target_gen_dir/vm_snapshot_instructions.bin" |
| 474 isolate_snapshot_data = "$target_gen_dir/isolate_snapshot_data.bin" | 471 isolate_snapshot_data = "$target_gen_dir/isolate_snapshot_data.bin" |
| 475 isolate_snapshot_instructions = | 472 isolate_snapshot_instructions = |
| 476 "$target_gen_dir/isolate_snapshot_instructions.bin" | 473 "$target_gen_dir/isolate_snapshot_instructions.bin" |
| 477 gen_snapshot_stamp_file = "$target_gen_dir/gen_snapshot.stamp" | 474 |
| 475 inputs = [ |
| 476 compilation_trace, |
| 477 ] |
| 478 outputs = [ | 478 outputs = [ |
| 479 vm_snapshot_data, | 479 vm_snapshot_data, |
| 480 vm_snapshot_instructions, | 480 vm_snapshot_instructions, |
| 481 isolate_snapshot_data, | 481 isolate_snapshot_data, |
| 482 isolate_snapshot_instructions, | 482 isolate_snapshot_instructions, |
| 483 gen_snapshot_stamp_file, | |
| 484 ] | 483 ] |
| 485 | 484 tool = ":gen_snapshot" |
| 486 gen_snapshot_dir = | |
| 487 get_label_info("../bin:gen_snapshot($host_toolchain)", "root_out_dir") | |
| 488 | |
| 489 script = rebase_path("../tools/create_snapshot_bin.py") | |
| 490 args = [ | 485 args = [ |
| 491 "--executable", | 486 "--snapshot_kind=" + dart_core_snapshot_kind, |
| 492 rebase_path("$gen_snapshot_dir/gen_snapshot"), | 487 "--load_compilation_trace=" + rebase_path(compilation_trace), |
| 493 "--snapshot_kind", | 488 "--vm_snapshot_data=" + rebase_path(vm_snapshot_data, root_build_dir), |
| 494 dart_core_snapshot_kind, | 489 "--vm_snapshot_instructions=" + |
| 495 "--vm_output_bin", | 490 rebase_path(vm_snapshot_instructions, root_build_dir), |
| 496 rebase_path(vm_snapshot_data, root_build_dir), | 491 "--isolate_snapshot_data=" + |
| 497 "--vm_instructions_output_bin", | 492 rebase_path(isolate_snapshot_data, root_build_dir), |
| 498 rebase_path(vm_snapshot_instructions, root_build_dir), | 493 "--isolate_snapshot_instructions=" + |
| 499 "--isolate_output_bin", | 494 rebase_path(isolate_snapshot_instructions, root_build_dir), |
| 500 rebase_path(isolate_snapshot_data, root_build_dir), | |
| 501 "--isolate_instructions_output_bin", | |
| 502 rebase_path(isolate_snapshot_instructions, root_build_dir), | |
| 503 "--timestamp_file", | |
| 504 rebase_path(gen_snapshot_stamp_file, root_build_dir), | |
| 505 ] | 495 ] |
| 506 } | 496 } |
| 507 | 497 |
| 508 # Generates an assembly file defining a given symbol with the bytes from a | 498 # Generates an assembly file defining a given symbol with the bytes from a |
| 509 # binary file. Places the symbol in a text section if 'executable' is true, | 499 # binary file. Places the symbol in a text section if 'executable' is true, |
| 510 # otherwise places the symbol in a read-only data section. | 500 # otherwise places the symbol in a read-only data section. |
| 511 template("bin_to_assembly") { | 501 template("bin_to_assembly") { |
| 512 assert(defined(invoker.deps), "Must define deps") | 502 assert(defined(invoker.deps), "Must define deps") |
| 513 assert(defined(invoker.input), "Must define input binary file") | 503 assert(defined(invoker.input), "Must define input binary file") |
| 514 assert(defined(invoker.output), "Must define output assembly file") | 504 assert(defined(invoker.output), "Must define output assembly file") |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 ] | 928 ] |
| 939 if (is_linux || is_android) { | 929 if (is_linux || is_android) { |
| 940 cflags = [ "-fPIC" ] | 930 cflags = [ "-fPIC" ] |
| 941 } | 931 } |
| 942 if (is_win) { | 932 if (is_win) { |
| 943 libs = [ "dart.lib" ] | 933 libs = [ "dart.lib" ] |
| 944 abs_root_out_dir = rebase_path(root_out_dir) | 934 abs_root_out_dir = rebase_path(root_out_dir) |
| 945 ldflags = [ "/LIBPATH:$abs_root_out_dir" ] | 935 ldflags = [ "/LIBPATH:$abs_root_out_dir" ] |
| 946 } | 936 } |
| 947 } | 937 } |
| OLD | NEW |