diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-12-01 01:53:37 -0500 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-12-03 13:44:21 -0800 |
commit | b39f4c146e7c13a7489e37b315a86e1a4a03a1a8 (patch) | |
tree | b943a4c19d57ee581c8efcc16b633754a4a34927 | |
parent | f727214db0677ebc31e0988287c71c517a858193 (diff) |
gn snapshot template's target_name should be target
-rw-r--r-- | BUILD.gn | 4 | ||||
-rw-r--r-- | libdeno/BUILD.gn | 8 | ||||
-rw-r--r-- | libdeno/deno.gni | 19 |
3 files changed, 12 insertions, 19 deletions
@@ -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 = [ diff --git a/libdeno/BUILD.gn b/libdeno/BUILD.gn index 652369718..47971ee01 100644 --- a/libdeno/BUILD.gn +++ b/libdeno/BUILD.gn @@ -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" } diff --git a/libdeno/deno.gni b/libdeno/deno.gni index 55662145f..896902207 100644 --- a/libdeno/deno.gni +++ b/libdeno/deno.gni @@ -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 ] } |