0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 17:34:47 -05:00

build: use compiled_action for create_snapshot.

Switch the order of the snapshot_creator args, in order to allow for
optional source map arg.
This commit is contained in:
Ryan Dahl 2018-07-26 14:41:36 -04:00
parent 9a42fcad9f
commit ae82db54f6
2 changed files with 8 additions and 16 deletions

View file

@ -1,4 +1,5 @@
# Copyright 2018 the Deno authors. All rights reserved. MIT license. # Copyright 2018 the Deno authors. All rights reserved. MIT license.
import("//build/compiled_action.gni")
template("run_node") { template("run_node") {
action(target_name) { action(target_name) {
@ -19,36 +20,27 @@ template("run_node") {
# snapshot. # snapshot.
template("create_snapshot") { template("create_snapshot") {
name = target_name name = target_name
suffix = "_$name" compiled_action("create_snapshot_" + name) {
action("create_snapshot_" + name) {
forward_variables_from(invoker, forward_variables_from(invoker,
[ [
"testonly", "testonly",
"deps", "deps",
]) ])
tool = ":snapshot_creator"
visibility = [ ":*" ] # Only targets in this file can depend on this. visibility = [ ":*" ] # Only targets in this file can depend on this.
deps += [ ":snapshot_creator" ] snapshot_out_cc = "$target_gen_dir/snapshot_$name.cc"
script = "//third_party/v8/tools/run.py" inputs = [
data = []
exe = rebase_path(get_label_info(":snapshot_creator", "root_out_dir") +
"/snapshot_creator")
snapshot_out_cc = "$target_gen_dir/snapshot${suffix}.cc"
sources = [
invoker.js, invoker.js,
] ]
outputs = [ outputs = [
snapshot_out_cc, snapshot_out_cc,
] ]
args = [ args = [
exe,
rebase_path(invoker.js, root_build_dir),
rebase_path(snapshot_out_cc, root_build_dir), rebase_path(snapshot_out_cc, root_build_dir),
rebase_path(invoker.js, root_build_dir),
] ]
# To debug snapshotting problems: # To debug snapshotting problems:
# args += ["--trace-serializer"] # args += ["--trace-serializer"]
data = [
invoker.js,
]
} }
} }

View file

@ -98,8 +98,8 @@ class StartupDataCppWriter {
} // namespace deno } // namespace deno
int main(int argc, char** argv) { int main(int argc, char** argv) {
const char* js_fn = argv[1]; const char* snapshot_out_cc = argv[1];
const char* snapshot_out_cc = argv[2]; const char* js_fn = argv[2];
v8::V8::SetFlagsFromCommandLine(&argc, argv, true); v8::V8::SetFlagsFromCommandLine(&argc, argv, true);