Skip to content

Commit

Permalink
build: added NINJA_BIN to customize ninja binary
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Aug 19, 2022
1 parent 5e57d24 commit 05449be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ $(NODE_EXE) $(NODE_G_EXE): config.gypi out/Makefile
ln -fs out/${build_type}/$(NODE_EXE) $@; fi
else
ifeq ($(BUILD_WITH), ninja)
NINJA_BIN ?= ninja
ifeq ($(V),1)
NINJA_ARGS := $(NINJA_ARGS) -v
endif
Expand All @@ -124,11 +125,11 @@ else
NINJA_ARGS := $(NINJA_ARGS) $(filter -j%,$(MAKEFLAGS))
endif
$(NODE_EXE): config.gypi out/Release/build.ninja
ninja -C out/Release $(NINJA_ARGS)
$(NINJA_BIN) -C out/Release $(NINJA_ARGS)
if [ ! -r $@ ] || [ ! -L $@ ]; then ln -fs out/Release/$(NODE_EXE) $@; fi

$(NODE_G_EXE): config.gypi out/Debug/build.ninja
ninja -C out/Debug $(NINJA_ARGS)
$(NINJA_BIN) -C out/Debug $(NINJA_ARGS)
if [ ! -r $@ ] || [ ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi
else
$(NODE_EXE) $(NODE_G_EXE):
Expand Down
8 changes: 8 additions & 0 deletions doc/contributing/building-node-with-ninja.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,12 @@ To create a debug build rather than a release build:
./configure --ninja --debug && make
```

## Customizing `ninja` path

On some systems (RHEL7 and below), `ninja` is not offered in the yum package.
For these systems use the `NINJA_BIN` env var:
```
./configure --ninja && NINJA_BIN="ninja-build" make
```

[Ninja]: https://ninja-build.org/

0 comments on commit 05449be

Please sign in to comment.