0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-24 20:29:23 +01:00
nodejs/doc/guides/building-node-with-ninja.md
Nick Schonning 6e8709df5b doc: remove shell dollar signs without output
Related to https://github.com/nodejs/remark-preset-lint-node/pull/94

PR-URL: https://github.com/nodejs/node/pull/33692
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-06-04 05:43:22 -07:00

1.4 KiB

Building Node.js with Ninja

The purpose of this guide is to show how to build Node.js using Ninja, as doing so can be significantly quicker than using make. Please see Ninja's site for installation instructions (Unix only).

Ninja is supported in the Makefile. Run ./configure --ninja to configure the project to run the regular make commands with Ninja.

For example, make will execute ninja -C out/Release internally to produce a compiled release binary, It will also execute ln -fs out/Release/node node, so that you can execute ./node at the project's root.

When running make, you will see output similar to the following if the build has succeeded:

ninja: Entering directory `out/Release`
[4/4] LINK node, POSTBUILDS

The bottom line will change while building, showing the progress as [finished/total] build steps. This is useful output that make does not produce and is one of the benefits of using Ninja. Also, Ninja will likely compile much faster than even make -j4 (or -j<number of processor threads on your machine>). You can still pass the number of processes to run for Ninja using the environment variable JOBS. This will be the equivalent to the -j parameter in the regular make:

JOBS=12 make

Producing a debug build

To create a debug build rather than a release build:

./configure --ninja --debug && make