summaryrefslogtreecommitdiff
path: root/node.gyp
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-04-18 16:26:48 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2019-04-23 11:26:01 +0800
commitd7016679509cd7f2d50612369509e8797d8157b0 (patch)
treee9d77bbe56e71b6c5ddb3b86547362f550ea2148 /node.gyp
parentffcc949f1cb72c19e4c7db6704ae02d0f7dac232 (diff)
downloadandroid-node-v8-d7016679509cd7f2d50612369509e8797d8157b0.tar.gz
android-node-v8-d7016679509cd7f2d50612369509e8797d8157b0.tar.bz2
android-node-v8-d7016679509cd7f2d50612369509e8797d8157b0.zip
tools: implement node_mksnapshot
Implements a node_mksnapshot target that generates a snapshot blob from a Node.js main instance's isolate, and serializes the data blob with other additional data into a C++ file that can be embedded into the Node.js binary. PR-URL: https://github.com/nodejs/node/pull/27321 Refs: https://github.com/nodejs/node/issues/17058 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'node.gyp')
-rw-r--r--node.gyp42
1 files changed, 41 insertions, 1 deletions
diff --git a/node.gyp b/node.gyp
index 7f534d8208..8019a16599 100644
--- a/node.gyp
+++ b/node.gyp
@@ -1156,7 +1156,47 @@
}],
],
}, # mkcodecache
- ], # end targets
+ {
+ 'target_name': 'node_mksnapshot',
+ 'type': 'executable',
+
+ 'dependencies': [
+ '<(node_lib_target_name)',
+ 'deps/histogram/histogram.gyp:histogram',
+ ],
+
+ 'includes': [
+ 'node.gypi'
+ ],
+
+ 'include_dirs': [
+ 'src',
+ 'tools/msvs/genfiles',
+ 'deps/v8/include',
+ 'deps/cares/include',
+ 'deps/uv/include',
+ ],
+
+ 'defines': [ 'NODE_WANT_INTERNALS=1' ],
+
+ 'sources': [
+ 'src/node_code_cache_stub.cc',
+ 'tools/snapshot/node_mksnapshot.cc',
+ 'tools/snapshot/snapshot_builder.cc',
+ 'tools/snapshot/snapshot_builder.h',
+ ],
+
+ 'conditions': [
+ [ 'node_report=="true"', {
+ 'conditions': [
+ ['OS=="win"', {
+ 'libraries': [ 'Ws2_32' ],
+ }],
+ ],
+ }],
+ ],
+ }, # node_mksnapshot
+ ], # end targets
'conditions': [
['OS=="aix" and node_shared=="true"', {