Skip to content

Commit 30da2b4

Browse files
jdxRafaelGSS
authored andcommitted
build: added NINJA env to customize ninja binary
Fixes: #44286 PR-URL: #44293 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 629e51d commit 30da2b4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ $(NODE_EXE) $(NODE_G_EXE): config.gypi out/Makefile
115115
ln -fs out/${build_type}/$(NODE_EXE) $@; fi
116116
else
117117
ifeq ($(BUILD_WITH), ninja)
118+
NINJA ?= ninja
118119
ifeq ($(V),1)
119120
NINJA_ARGS := $(NINJA_ARGS) -v
120121
endif
@@ -124,11 +125,11 @@ else
124125
NINJA_ARGS := $(NINJA_ARGS) $(filter -j%,$(MAKEFLAGS))
125126
endif
126127
$(NODE_EXE): config.gypi out/Release/build.ninja
127-
ninja -C out/Release $(NINJA_ARGS)
128+
$(NINJA) -C out/Release $(NINJA_ARGS)
128129
if [ ! -r $@ ] || [ ! -L $@ ]; then ln -fs out/Release/$(NODE_EXE) $@; fi
129130

130131
$(NODE_G_EXE): config.gypi out/Debug/build.ninja
131-
ninja -C out/Debug $(NINJA_ARGS)
132+
$(NINJA) -C out/Debug $(NINJA_ARGS)
132133
if [ ! -r $@ ] || [ ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi
133134
else
134135
$(NODE_EXE) $(NODE_G_EXE):

doc/contributing/building-node-with-ninja.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,13 @@ To create a debug build rather than a release build:
4040
./configure --ninja --debug && make
4141
```
4242

43+
## Customizing `ninja` path
44+
45+
On some systems (such as RHEL7 and below), the Ninja binary might be installed
46+
with a different name. For these systems use the `NINJA` env var:
47+
48+
```bash
49+
./configure --ninja && NINJA="ninja-build" make
50+
```
51+
4352
[Ninja]: https://ninja-build.org/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy