I was using Ninja 1.8.2 on Debian 9 to build llvm-6.0 using llvm-5.0.
When I inspected the CPU usage of my system, I found the CPU is not 100% used, and there's plenty memory left.
After checking the output of cmake, I found it limiting the parallel linking jobs to 2 because the llvm running on my machine runs in parallel too.
I want to try whether lifting that limit will enable my build to be faster, but there's hardly any document about that.
Edit:
I checked the content of the rules.ninja file in my build dir, and found these:
#############################################
# Pools defined by global property JOB_POOLS
pool link_job_pool
depth = 2
I also checked the content of build.ninja and found this:
build lib/libLLVMDemangle.a: CXX_STATIC_LIBRARY_LINKER__LLVMDemangle lib/Demangle/CMakeFiles/LLVMDemangle.dir/ItaniumDemangle.cpp.o
LANGUAGE_COMPILE_FLAGS = -Ofast -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++1y -Wal l -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -W non-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fcolor-diagnostics -ffunction-sections -fdata-sections -flto=thin -O3 -D NDEBUG
OBJECT_DIR = lib/Demangle/CMakeFiles/LLVMDemangle.dir
POST_BUILD = :
PRE_LINK = :
TARGET_FILE = lib/libLLVMDemangle.a
TARGET_PDB = LLVMDemangle.a.dbg
pool = link_job_pool
It seems that other commands for linking all have the arg pool
.