From d7016679509cd7f2d50612369509e8797d8157b0 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 18 Apr 2019 16:26:48 +0800 Subject: 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 Reviewed-By: Refael Ackermann Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis --- node.gyp | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'node.gyp') 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"', { -- cgit v1.2.3