Well something like: $ npm install -g node-gyp $ $ cd my-addon $ node-gyp configure (generate the Makefile/VC project in cwd from gyp) $ node-gyp build (do the actual build, either with Make or msbuild, depending on the platform)
Then you would have either "out/Debug/bindings.node" or "out/Release/bindings.node" depending on the build type. We could have `node-gyp configure --debug` make a Debug build and then default to a Release build, kinda like how Node does it in its configure/Makefile. That would normalize the commands needed for building on the various platforms, which is a big step. node-gyp should have the ability to select/install header files from different versions of Node, as well as download precompiled node.lib files for Windows (`node-waf configure --target=0.6.x` maybe). I'm not sure what else it would need off the top of my head. Thoughts? On Thu, Feb 2, 2012 at 11:01 AM, Isaac Schlueter <[email protected]> wrote: > Let's start with: > > "I already wrote a little binding C++ thing for node, and now I want > to compile a .node file." Start with the example in node's > test/addons/hello-world. > > Right now, that is unnecessarily difficult, and I believe it's a good > sized problem to tackle. How would you make it trivial to do that? > > > > On Thu, Feb 2, 2012 at 00:58, Nathan Rajlich <[email protected]> > wrote: > > The compiler used *may* be another paramater to consider, but I haven't > ran > > into any problems in use with node-bindings yet. One issue getting the > > compiler name is that it's not available in node anywhere, so getting > that > > value at runtime would be hard/impossible. > > > > > > On Wed, Feb 1, 2012 at 6:38 PM, Robert Mustacchi <[email protected]> > wrote: > >> > >> On 02/01/2012 04:52 PM, Isaac Schlueter wrote: > >>> > >>> On Wed, Feb 1, 2012 at 16:15, Nathan Rajlich<[email protected]> > >>> wrote: > >>>> > >>>> Devs have to now compile for each supported platform and architecture > >>>> before > >>>> publishing > >>> > >>> > >>> Problem 1 is indeed a problem, but it can be solved in 2 ways. > >>> > >>> 1. If you have the toolchain installed, you'll be able to build at > >>> install time, just like you do today with node-waf, so there's a > >>> fallback. > >>> 2. We'll build some cloudy buildbot CI stuff to compile all the things. > >>> > >>> Node-bindings could definitely be handy. > >> > >> > >> There is no stable C++ ABI, so you will also have to add the compiler > >> version as another argument to that list of targets. Some compilers do > try > >> to do versioning with mapfiles, but it is rarely used. The worst thing > that > >> can happen is having a version of node built with one version of a > compiler > >> and an addon with another. > >> > >> Robert > > > > > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
