2018-07-23 14:46:30 -04:00
|
|
|
# Copyright 2018 the Deno authors. All rights reserved. MIT license.
|
2018-07-26 14:41:36 -04:00
|
|
|
import("//build/compiled_action.gni")
|
2018-07-23 14:46:30 -04:00
|
|
|
|
2018-06-15 14:02:27 -04:00
|
|
|
template("run_node") {
|
|
|
|
action(target_name) {
|
|
|
|
forward_variables_from(invoker, "*")
|
2018-07-08 02:24:29 -04:00
|
|
|
script = "//tools/run_node.py"
|
2018-06-15 14:02:27 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Template to generate different V8 snapshots based on different runtime flags.
|
|
|
|
# Can be invoked with run_mksnapshot(<name>). The target will resolve to
|
|
|
|
# run_mksnapshot_<name>. If <name> is "default", no file suffixes will be used.
|
|
|
|
# Otherwise files are suffixed, e.g. embedded_<name>.cc and
|
|
|
|
# snapshot_blob_<name>.bin.
|
|
|
|
#
|
|
|
|
# The template exposes the variables:
|
|
|
|
# args: additional flags for mksnapshots
|
|
|
|
# embedded_suffix: a camel case suffix for method names in the embedded
|
|
|
|
# snapshot.
|
|
|
|
template("create_snapshot") {
|
|
|
|
name = target_name
|
2018-07-26 14:41:36 -04:00
|
|
|
compiled_action("create_snapshot_" + name) {
|
2018-06-15 14:02:27 -04:00
|
|
|
forward_variables_from(invoker,
|
|
|
|
[
|
|
|
|
"testonly",
|
|
|
|
"deps",
|
|
|
|
])
|
2018-07-26 14:41:36 -04:00
|
|
|
tool = ":snapshot_creator"
|
2018-06-15 14:02:27 -04:00
|
|
|
visibility = [ ":*" ] # Only targets in this file can depend on this.
|
2018-07-26 23:21:10 -04:00
|
|
|
snapshot_out_bin = "$target_gen_dir/snapshot_$name.bin"
|
2018-07-26 14:41:36 -04:00
|
|
|
inputs = [
|
2018-06-15 14:02:27 -04:00
|
|
|
invoker.js,
|
|
|
|
]
|
2018-08-02 13:13:32 -04:00
|
|
|
if (defined(invoker.source_map)) {
|
|
|
|
inputs += [ invoker.source_map ]
|
|
|
|
}
|
2018-06-15 14:02:27 -04:00
|
|
|
outputs = [
|
2018-07-26 23:21:10 -04:00
|
|
|
snapshot_out_bin,
|
2018-06-15 14:02:27 -04:00
|
|
|
]
|
2018-08-02 13:13:32 -04:00
|
|
|
args = rebase_path(outputs, root_build_dir) +
|
|
|
|
rebase_path(inputs, root_build_dir)
|
2018-06-15 14:02:27 -04:00
|
|
|
|
|
|
|
# To debug snapshotting problems:
|
|
|
|
# args += ["--trace-serializer"]
|
|
|
|
}
|
|
|
|
}
|