From 92a56fc25413ed4fc3905ada4b4712367ee43500 Mon Sep 17 00:00:00 2001 From: Bradley Sepos Date: Sun, 8 Sep 2019 01:41:55 -0400 Subject: build: make: macosx: Make xcodebuild use number of jobs passed to make. Fixes #1648. Previously, it was always using the number of jobs in the makefile created by configure.py, either specified by --launch-jobs or the number of active CPU cores. --- macosx/module.defs | 4 ++-- macosx/module.xcodebuild | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'macosx') diff --git a/macosx/module.defs b/macosx/module.defs index 20daeef5a..cbf537a4c 100644 --- a/macosx/module.defs +++ b/macosx/module.defs @@ -62,7 +62,7 @@ MACOSX.XCODE = $(strip \ EXTERNAL_CONF_ARGS='$(CONF.args)' \ EXTERNAL_DRIVER='$(XCODE.driver)' \ EXTERNAL_GOALS='$(3)' \ - EXTERNAL_JOBS='$(BUILD.jobs)' \ + EXTERNAL_JOBS='$(MACOSX.JOBS)' \ EXTERNAL_VARS='$(-*-command-variables-*-)' \ \ $(MACOSX.extra_cflags) \ @@ -87,7 +87,7 @@ MACOSX.XCODE_ARCHIVE = $(strip \ EXTERNAL_CONF_ARGS='$(CONF.args)' \ EXTERNAL_DRIVER='$(XCODE.driver)' \ EXTERNAL_GOALS='$(3)' \ - EXTERNAL_JOBS='$(BUILD.jobs)' \ + EXTERNAL_JOBS='$(MACOSX.JOBS)' \ EXTERNAL_VARS='$(-*-command-variables-*-)' \ \ $(MACOSX.extra_cflags) \ diff --git a/macosx/module.xcodebuild b/macosx/module.xcodebuild index 960e64562..cb66479d7 100644 --- a/macosx/module.xcodebuild +++ b/macosx/module.xcodebuild @@ -52,3 +52,11 @@ $(MACOSX.goals): __goals__ __goals__: $(call MACOSX.XCODE,external,build,$(MACOSX.goals)) + +############################################################################### + +MACOSX.JOBS := $(shell ps T | $(GREP.exe) "^\s*$(shell echo $$PPID).*$(MAKE)" | $(GREP.exe) -o "\(\-j\|\-\-jobs\)[= ]*[^\s]*" | $(GREP.exe) -o "[0-9][0-9]*") +ifeq "${MACOSX.JOBS}" "" + # fall back to number of jobs specified in makefile created by configure + MACOSX.JOBS := $(BUILD.jobs) +endif -- cgit v1.2.3