aboutsummaryrefslogtreecommitdiff
path: root/helpers/llvm-build
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/llvm-build')
-rwxr-xr-xhelpers/llvm-build14
1 files changed, 10 insertions, 4 deletions
diff --git a/helpers/llvm-build b/helpers/llvm-build
index 7e00b2b..5ef0662 100755
--- a/helpers/llvm-build
+++ b/helpers/llvm-build
@@ -11,14 +11,14 @@
safe_run verify_env
## CMD line options and defaults
-CPUs=`grep -c proc /proc/cpuinfo`
+PARALLEL=-j`grep -c proc /proc/cpuinfo`
build_dir=$LLVM_BLD
install_dir=$LLVM_INSTALL
build_type=Release
shared=
targets=
prog=`basename $0`
-syntax="Syntax: $prog [targets]"
+syntax="Syntax: $prog [-jN] [targets]"
update=false
check=false
master=false
@@ -62,14 +62,20 @@ if [ ! -f build.ninja ] && [ ! -f Makefile ]; then
$targets $shared
fi
+## Allow the user to override the number of CPUs used with -jN
+if [[ $1 =~ -j[0-9]+ ]]; then
+ PARALLEL=$1
+ shift
+fi
+
## Build
if [ "$1" == "" ]; then
echo " + Building LLVM"
- safe_run $make -j$CPUs
+ safe_run $make $PARALLEL
else
for target in "$@"; do
echo " + Running $target"
- safe_run $make -j$CPUs $target
+ safe_run $make $PARALLEL $target
done
fi