Improve build times on non-x86 systems

Signed-off-by: Alexander F. Lent <lx@xanderlent.com>
This commit is contained in:
Alexander F. Lent 2025-12-18 09:08:09 -05:00
commit 7ddebb112b

View file

@ -506,10 +506,15 @@ sed -i -e 's@${PROJECT_SOURCE_DIR}/third_party/concurrentqueue@/usr/include/conc
# Control the number of jobs
#
# The build can fail if too many threads exceed the physical memory
# So count core and and memory and increase the build memory util the build succeeds
# Run at least one thread, more if CPU & memory resources are available.
#
%ifarch x86_64
# Real cores, No hyperthreading
COMPILE_JOBS=`cat /proc/cpuinfo | grep -m 1 'cpu cores' | awk '{ print $4 }'`
%else
# cpuinfo format varies on other arches, fall back to nproc
COMPILE_JOBS=`nproc`
%endif
if [ ${COMPILE_JOBS}x = x ]; then
COMPILE_JOBS=1
fi