Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: added NINJA env to customize ninja binary #44293

Merged
merged 3 commits into from Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions Makefile
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 ?= 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) -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) -C out/Debug $(NINJA_ARGS)
if [ ! -r $@ ] || [ ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi
else
$(NODE_EXE) $(NODE_G_EXE):
Expand Down
9 changes: 9 additions & 0 deletions doc/contributing/building-node-with-ninja.md
Expand Up @@ -40,4 +40,13 @@ To create a debug build rather than a release build:
./configure --ninja --debug && make
```

## Customizing `ninja` path

On some systems (such as RHEL7 and below), the Ninja binary might be installed
with a different name. For these systems use the `NINJA` env var:

```bash
./configure --ninja && NINJA="ninja-build" make
```

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