build: fix -j propagation to ninja
The expression containing MAKEFLAGS must be evaluated in a deferred context for the propagation to work in GNU make. Otherwise, regardless of the -j value passed to make, ninja will spawn a potentially greater number of parallel compilation tasks, which can quickly exhaust all available memory. PR-URL: https://github.com/nodejs/node/pull/53088 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
177b8b957b
commit
19f0bcaa62
3
Makefile
3
Makefile
@ -146,7 +146,8 @@ endif
|
||||
ifdef JOBS
|
||||
NINJA_ARGS := $(NINJA_ARGS) -j$(JOBS)
|
||||
else
|
||||
NINJA_ARGS := $(NINJA_ARGS) $(filter -j%,$(MAKEFLAGS))
|
||||
IMMEDIATE_NINJA_ARGS := $(NINJA_ARGS)
|
||||
NINJA_ARGS = $(IMMEDIATE_NINJA_ARGS) $(filter -j%,$(MAKEFLAGS))
|
||||
endif
|
||||
$(NODE_EXE): config.gypi out/Release/build.ninja
|
||||
$(NINJA) -C out/Release $(NINJA_ARGS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user