aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Hundebøll <martin@geanix.com>2024-04-02 10:17:38 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-04-08 10:04:44 +0200
commitd1ce2cc95b71f41860bdff6f81c333cec11eae80 (patch)
treecc828275bb8b50edee357cb07605043b09aae265
parentce64e6224affb8b4e4b019f76d2950270b391af5 (diff)
downloadqemu-d1ce2cc95b71f41860bdff6f81c333cec11eae80.zip
qemu-d1ce2cc95b71f41860bdff6f81c333cec11eae80.tar.gz
qemu-d1ce2cc95b71f41860bdff6f81c333cec11eae80.tar.bz2
Makefile: preserve --jobserver-auth argument when calling ninja
Qemu wraps its call to ninja in a Makefile. Since ninja, as opposed to make, utilizes all CPU cores by default, the qemu Makefile translates the absense of a `-jN` argument into `-j1`. This breaks jobserver functionality, so update the -jN mangling to take the --jobserver-auth argument into considerationa too. Signed-off-by: Martin Hundebøll <martin@geanix.com> Message-Id: <20240402081738.1051560-1-martin@geanix.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 8f36990..1837560 100644
--- a/Makefile
+++ b/Makefile
@@ -142,7 +142,7 @@ MAKE.k = $(findstring k,$(firstword $(filter-out --%,$(MAKEFLAGS))))
MAKE.q = $(findstring q,$(firstword $(filter-out --%,$(MAKEFLAGS))))
MAKE.nq = $(if $(word 2, $(MAKE.n) $(MAKE.q)),nq)
NINJAFLAGS = $(if $V,-v) $(if $(MAKE.n), -n) $(if $(MAKE.k), -k0) \
- $(filter-out -j, $(lastword -j1 $(filter -l% -j%, $(MAKEFLAGS)))) \
+ $(or $(filter -l% -j%, $(MAKEFLAGS)), $(if $(filter --jobserver-auth=%, $(MAKEFLAGS)),, -j1)) \
-d keepdepfile
ninja-cmd-goals = $(or $(MAKECMDGOALS), all)
ninja-cmd-goals += $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g))