Make it possible to change the number of remote jobs
User can overwrite NINJA_REMOTE_NUM_JOBS for this purpose. The number is passed to ninja instead of to kati so no we don't need to regenerate a ninja file when a user changes this value. Change-Id: I2ccfaaae4492d84a8b8045dff612cb5f6ebe2c79
This commit is contained in:
parent
964f06b178
commit
c1cba69970
|
@ -52,11 +52,6 @@ ifneq ($(USE_GOMA),)
|
||||||
CC_WRAPPER := $(strip $(CC_WRAPPER) $(goma_cc))
|
CC_WRAPPER := $(strip $(CC_WRAPPER) $(goma_cc))
|
||||||
CXX_WRAPPER := $(strip $(CXX_WRAPPER) $(goma_cc))
|
CXX_WRAPPER := $(strip $(CXX_WRAPPER) $(goma_cc))
|
||||||
|
|
||||||
# Ninja file generated by kati uses this for remote jobs (i.e.,
|
|
||||||
# commands which contain gomacc). Note the parallelism of all other
|
|
||||||
# jobs will be limited the number of cores.
|
|
||||||
KATI_REMOTE_NUM_JOBS_FLAG := --remote_num_jobs=500
|
|
||||||
|
|
||||||
# gomacc can start goma client's daemon process automatically, but
|
# gomacc can start goma client's daemon process automatically, but
|
||||||
# it is safer and faster to start up it beforehand. We run this as a
|
# it is safer and faster to start up it beforehand. We run this as a
|
||||||
# background process so this won't slow down the build.
|
# background process so this won't slow down the build.
|
||||||
|
|
|
@ -105,8 +105,13 @@ PHONY: showcommands
|
||||||
showcommands: droid
|
showcommands: droid
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef KATI_REMOTE_NUM_JOBS_FLAG
|
ifdef USE_GOMA
|
||||||
KATI_MAKEPARALLEL := $(MAKEPARALLEL)
|
KATI_MAKEPARALLEL := $(MAKEPARALLEL)
|
||||||
|
# Ninja runs remote jobs (i.e., commands which contain gomacc) with
|
||||||
|
# this parallelism. Note the parallelism of all other jobs is still
|
||||||
|
# limited by the -j flag passed to GNU make.
|
||||||
|
NINJA_REMOTE_NUM_JOBS ?= 500
|
||||||
|
NINJA_ARGS += -j$(NINJA_REMOTE_NUM_JOBS)
|
||||||
else
|
else
|
||||||
NINJA_MAKEPARALLEL := $(MAKEPARALLEL) --ninja
|
NINJA_MAKEPARALLEL := $(MAKEPARALLEL) --ninja
|
||||||
endif
|
endif
|
||||||
|
@ -133,7 +138,7 @@ $(KATI_OUTPUTS): kati.intermediate $(KATI_FORCE)
|
||||||
.INTERMEDIATE: kati.intermediate
|
.INTERMEDIATE: kati.intermediate
|
||||||
kati.intermediate: $(KATI) $(MAKEPARALLEL)
|
kati.intermediate: $(KATI) $(MAKEPARALLEL)
|
||||||
@echo Running kati to generate build$(KATI_NINJA_SUFFIX).ninja...
|
@echo Running kati to generate build$(KATI_NINJA_SUFFIX).ninja...
|
||||||
+$(hide) $(KATI_MAKEPARALLEL) $(KATI) --ninja --ninja_dir=$(PRODUCT_OUT) --ninja_suffix=$(KATI_NINJA_SUFFIX) --regen --ignore_dirty=$(OUT_DIR)/% --ignore_optional_include=$(OUT_DIR)/%.P --detect_android_echo --use_find_emulator $(KATI_REMOTE_NUM_JOBS_FLAG) -f build/core/main.mk $(or $(KATI_TARGETS),--gen_all_phony_targets) USE_NINJA=false
|
+$(hide) $(KATI_MAKEPARALLEL) $(KATI) --ninja --ninja_dir=$(PRODUCT_OUT) --ninja_suffix=$(KATI_NINJA_SUFFIX) --regen --ignore_dirty=$(OUT_DIR)/% --ignore_optional_include=$(OUT_DIR)/%.P --detect_android_echo --use_find_emulator -f build/core/main.mk $(or $(KATI_TARGETS),--gen_all_phony_targets) USE_NINJA=false
|
||||||
|
|
||||||
KATI_CXX := $(CLANG_CXX) $(CLANG_HOST_GLOBAL_CFLAGS) $(CLANG_HOST_GLOBAL_CPPFLAGS)
|
KATI_CXX := $(CLANG_CXX) $(CLANG_HOST_GLOBAL_CFLAGS) $(CLANG_HOST_GLOBAL_CPPFLAGS)
|
||||||
KATI_LD := $(CLANG_CXX) $(CLANG_HOST_GLOBAL_LDFLAGS)
|
KATI_LD := $(CLANG_CXX) $(CLANG_HOST_GLOBAL_LDFLAGS)
|
||||||
|
|
Loading…
Reference in New Issue