0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00

gn snapshot template's target_name should be target

This commit is contained in:
Ryan Dahl 2018-12-01 01:53:37 -05:00
parent f727214db0
commit b39f4c146e
3 changed files with 12 additions and 19 deletions

View file

@ -113,8 +113,8 @@ ts_sources = [
group("deno_deps") {
deps = [
":create_snapshot_deno",
":msg_rs",
":snapshot_deno",
"libdeno:libdeno",
]
}
@ -210,7 +210,7 @@ rust_flatbuffer("msg_rs") {
}
# Generates $target_gen_dir/snapshot_deno.bin
create_snapshot("deno") {
snapshot("snapshot_deno") {
js = "$target_gen_dir/bundle/main.js"
source_map = "$target_gen_dir/bundle/main.js.map"
deps = [

View file

@ -83,20 +83,20 @@ v8_executable("test_cc") {
"test.cc",
]
deps = [
":create_snapshot_libdeno_test",
":libdeno",
":snapshot_test",
"//testing/gtest:gtest",
]
data = [
"$target_gen_dir/snapshot_libdeno_test.bin",
"$target_gen_dir/snapshot_test.bin",
]
snapshot_path = rebase_path(data[0], root_build_dir)
defines = [ "SNAPSHOT_PATH=\"$snapshot_path\"" ]
configs = [ ":deno_config" ]
}
# Generates $target_gen_dir/snapshot_libdeno_test.bin
create_snapshot("libdeno_test") {
# Generates $target_gen_dir/snapshot_test.bin
snapshot("snapshot_test") {
testonly = true
js = "libdeno_test.js"
}

View file

@ -14,18 +14,8 @@ template("run_node") {
}
# 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
compiled_action("create_snapshot_" + name) {
template("snapshot") {
compiled_action(target_name) {
forward_variables_from(invoker,
[
"testonly",
@ -33,10 +23,13 @@ template("create_snapshot") {
])
tool = "//libdeno:snapshot_creator"
visibility = [ ":*" ] # Only targets in this file can depend on this.
snapshot_out_bin = "$target_gen_dir/snapshot_$name.bin"
snapshot_out_bin = "$target_gen_dir/$target_name.bin"
inputs = [
invoker.js,
]
# TODO(ry) source_map should not be involved at this layer. Remove the
# following.
if (defined(invoker.source_map)) {
inputs += [ invoker.source_map ]
}