summaryrefslogtreecommitdiff
path: root/node.gyp
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-04-04 06:29:02 +0800
committerRefael Ackermann <refack@gmail.com>2019-04-16 18:23:32 -0400
commit4fd71935795fa7c284f5ed621551b65a28b8271c (patch)
tree63a90841b3ac80aab7c28c64d0b6dc46e2f19c82 /node.gyp
parent1c2616971417bee811ea00da436c87a489f9b1ed (diff)
downloadandroid-node-v8-4fd71935795fa7c284f5ed621551b65a28b8271c.tar.gz
android-node-v8-4fd71935795fa7c284f5ed621551b65a28b8271c.tar.bz2
android-node-v8-4fd71935795fa7c284f5ed621551b65a28b8271c.zip
tools: implement mkcodecache as an executable
This patch implement a mkcodecache executable on top of the `NativeModuleLoader` singleton. This makes it possible to build a Node.js binary with embedded code cache without building itself using the code cache stub - the cache is now initialized by `NativeModuleEnv` instead which can be refactored out of the mkcodecache dependencies. PR-URL: https://github.com/nodejs/node/pull/27161 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'node.gyp')
-rw-r--r--node.gyp53
1 files changed, 53 insertions, 0 deletions
diff --git a/node.gyp b/node.gyp
index ead1d67ff2..e5e0ad144f 100644
--- a/node.gyp
+++ b/node.gyp
@@ -1103,6 +1103,59 @@
}],
],
}, # cctest
+ # TODO(joyeecheung): do not depend on node_lib,
+ # instead create a smaller static library node_lib_base that does
+ # just enough for node_native_module.cc and the cache builder to
+ # compile without compiling the generated code cache C++ file.
+ # So generate_code_cache -> mkcodecache -> node_lib_base,
+ # node_lib -> node_lib_base & generate_code_cache
+ {
+ 'target_name': 'mkcodecache',
+ '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': [
+ 'tools/code_cache/mkcodecache.cc',
+ 'tools/code_cache/cache_builder.cc'
+ ],
+
+ 'conditions': [
+ [ 'node_report=="true"', {
+ 'conditions': [
+ ['OS=="win"', {
+ 'libraries': [
+ 'dbghelp.lib',
+ 'PsApi.lib',
+ 'Ws2_32.lib',
+ ],
+ 'dll_files': [
+ 'dbghelp.dll',
+ 'PsApi.dll',
+ 'Ws2_32.dll',
+ ],
+ }],
+ ],
+ }],
+ ],
+ }, # cache_builder
], # end targets
'conditions': [