build: add ninja build tool and make it available for cmake

ninja is faster at building cmake packages than make, and according to reports
also more reliable at handling parallel builds
This commit includes a patch that adds GNU make jobserver support, in order to
allow more precise control over the number of parallel tasks

Enable parallel build by default for packages using ninja

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Felix Fietkau
2021-06-06 14:31:01 +02:00
parent a85aaa1bc2
commit 97258f5363
5 changed files with 2359 additions and 1 deletions

View File

@@ -342,6 +342,12 @@ else
$(SCRIPT_DIR)/rstrip.sh
endif
NINJA = \
MAKEFLAGS="$(MAKE_JOBSERVER)" \
$(STAGING_DIR_HOST)/bin/ninja \
$(if $(findstring c,$(OPENWRT_VERBOSE)),-v) \
$(if $(MAKE_JOBSERVER),,-j1)
ifeq ($(CONFIG_IPV6),y)
DISABLE_IPV6:=
else