Node -gyp build dependency libraries

I want to find a way to simplify the installation of the Node.js " libtorrent module.

My goal is to provide precompiled .node files for each architecture, as this is done in the fibers module for example.

Thus, users can install the module without having to install dependencies, compile, etc.

My question is: if I want to do this, do I need to include all the dependencies (libtorrent and some Boost extensions) inside the project and create them using node -gyp? Or if I create a module in my system with the installed dependencies, will they be included in the final .node file?

Thank you for your help.

+7
boost node-gyp gyp libtorrent
source share
1 answer

Since Boost and Node are C ++ programs, their names (e.g. functions) become garbled at compile time. When they are not compiled together, they theoretically will not be able to know each other. .node files are in binary format, and gyp does not have the functionality that I know that can associate binary characters.

So I'm sure you need to compile them at dev time. I think this will also support your general idea of ​​providing precompiled material, although of course it will significantly increase the file size.

0
source share

All Articles