Skip to content

Commit 34c9e36

Browse files
committed
doc: add gyp.js usage to README
Added description for new command-line options and environment variables. See: nodejs#960
1 parent a5bdec6 commit 34c9e36

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,37 @@ you can require the `.node` file with Node and run your tests!
106106
__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or
107107
`-d`) switch when running either the `configure`, `build` or `rebuild` command.
108108

109+
#### Usage without Python
110+
111+
There is a [`gyp.js`](https://github.com/indutny/gyp.js/) project, a GYP
112+
implementation in JavaScript. It generates [`Ninja`](https://ninja-build.org/)
113+
build files and requires no Python installation.
114+
115+
In this case you will need to install [`Ninja`](https://ninja-build.org/) build
116+
tool and a C/C++ compiler toolchain.
117+
118+
To generate projects files with `gyp.js` instead of `gyp` and to build them with
119+
`ninja`, please supply a command-line option `--gypjs` in `node-gyp` command.
120+
121+
``` bash
122+
$ node-gyp configure --gypjs
123+
```
124+
125+
It is also possible to set `npm_config_gypjs` environment variable to turn on
126+
the `gyp.js` usage.
127+
128+
``` bash
129+
$ npm_config_gypjs=1 node-gyp build
130+
```
131+
132+
Path to an existing `ninja` installation can be set with a `--ninja` command-line
133+
option or in a `NINJA` environment variable.
134+
135+
``` bash
136+
$ node-gyp configure --gypjs --ninja=/my/path/to/ninja
137+
$ npm_config_gypjs=1 NINJA=/my/path/to/ninja node-gyp build
138+
```
139+
109140

110141
The "binding.gyp" file
111142
----------------------
@@ -182,6 +213,7 @@ Command Options
182213
| `--msvs_version=$version` | Set Visual Studio version (win)
183214
| `--solution=$solution` | Set Visual Studio Solution version (win)
184215
| `--gypjs` | Use gyp.js instead of gyp
216+
| `--ninja=$ninja` | Override ninja command (with --gypjs)
185217

186218

187219
License

0 commit comments

Comments
 (0)