Skip to content

Commit af7d42e

Browse files
authored
doc: add instructions to build with ninja (#1709)
1 parent fe0c48e commit af7d42e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ Multiple filter conditions can be joined to broaden the test selection
9292
compile and run all tests under folders threadsafe_function and typed_threadsafe_function and also the objectwrap.cc file
9393
npm run unit --filter='*function objectwrap'
9494

95+
As an alternative, `ninja` can be used to build the tests. Please
96+
follow the instructions in [Build with ninja](doc/contributing/build_with_ninja.md).
97+
9598
## Debug
9699

97100
To run the **node-addon-api** tests with `--debug` option:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Build Test with Ninja
2+
3+
Ninja can be used to speed up building tests with optimized parallelism.
4+
5+
To build the tests with ninja and node-gyp, run the following commands:
6+
7+
```sh
8+
/node-addon-api $ node-gyp configure -C test -- -f ninja
9+
/node-addon-api $ ninja -C test/build/Release
10+
# Run tests
11+
/node-addon-api $ node ./test/index.js
12+
13+
# Run tests with debug addon
14+
/node-addon-api $ ninja -C test/build/Debug
15+
/node-addon-api $ NODE_API_BUILD_CONFIG=Debug node ./test/index.js
16+
```

0 commit comments

Comments
 (0)