diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-07-16 21:33:57 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-07-18 15:43:50 -0400 |
commit | 8a4e3dfda4975540d6e0059248477facfe03c31c (patch) | |
tree | fd4c1c43ea631ad400c56773ef939d65d0a7fba3 | |
parent | 2f94c5b48bfb6c9f5bce49af633100ae730a88c2 (diff) |
Minimize snapshot deps by adding deno_base target.
Also adds main.map to bundle outputs in GN.
-rw-r--r-- | BUILD.gn | 45 |
1 files changed, 36 insertions, 9 deletions
@@ -93,18 +93,14 @@ executable("deno_cc_nosnapshot") { executable("test_cc") { testonly = true sources = [ - "src/file_util_test.cc", "src/flatbuffer_builder_test.cc", - "src/from_snapshot.cc", - "src/mock_runtime_test.cc", "src/test.cc", ] deps = [ - ":create_snapshot_mock_runtime", + ":deno_base_test", ":deno_bindings", "//testing/gtest:gtest", ] - defines = [ "DENO_MOCK_RUNTIME" ] configs += [ ":deno_config" ] } @@ -120,18 +116,48 @@ static_library("libdeno") { configs += [ ":deno_config" ] } -v8_source_set("deno_bindings") { +# Only functionality needed for mock_runtime_test and snapshot_creator +# In particular no flatbuffers, no assets, no rust, no msg handlers. +# Because snapshots are slow, it's important that snapshot_creator's +# dependencies are minimal. +v8_source_set("deno_base") { sources = [ "src/binding.cc", "src/deno.h", "src/file_util.cc", "src/file_util.h", + "src/internal.h", + ] + public_deps = [ + "third_party/v8:v8_monolith", + ] + configs = [ ":deno_config" ] +} + +v8_source_set("deno_base_test") { + testonly = true + sources = [ + "src/file_util_test.cc", + "src/from_snapshot.cc", + "src/mock_runtime_test.cc", + ] + deps = [ + ":create_snapshot_mock_runtime", + ":deno_base", + "//testing/gtest:gtest", + ] + defines = [ "DENO_MOCK_RUNTIME" ] + configs = [ ":deno_config" ] +} + +v8_source_set("deno_bindings") { + sources = [ "src/flatbuffer_builder.cc", "src/flatbuffer_builder.h", - "src/internal.h", ] deps = [ - "third_party/v8:v8_monolith", + ":deno_base", + ":msg_cpp", ] public_deps = [ "build_extra/flatbuffers:flatbuffers", @@ -144,7 +170,7 @@ executable("snapshot_creator") { "src/snapshot_creator.cc", ] deps = [ - ":deno_bindings", + ":deno_base", ] configs += [ ":deno_config" ] } @@ -172,6 +198,7 @@ run_node("bundle") { ] outputs = [ out_dir + "main.js", + out_dir + "main.map", ] deps = [ ":flatbufferjs", |