Allow custom number of cores to compile via build.sh #137

This commit is contained in:
Duke
2024-01-14 09:19:39 -05:00
parent df67f779f7
commit fd5eec230e
2 changed files with 6 additions and 12 deletions

View File

@@ -4,16 +4,6 @@
UNAME=$(uname)
if [ "$UNAME" == "Linux" ] ; then
JOBS=2
elif [ "$UNAME" == "FreeBSD" ] ; then
JOBS=$(nproc)
elif [ "$UNAME" == "Darwin" ] ; then
JOBS=$(sysctl -n hw.ncpu)
else
JOBS=1
fi
# check if rustc and cargo are installed, otherwise exit with error
if ! command -v rustc &> /dev/null
then
@@ -40,7 +30,7 @@ then
fi
VERSION=$(cat src/version.h |cut -d\" -f2)
echo "Compiling SilentDragonLite $VERSION with $JOBS threads..."
echo "Compiling SilentDragonLite $VERSION on $UNAME with args=$@"
CONF=silentdragon-lite.pro
set -e
@@ -48,7 +38,8 @@ qbuild () {
qmake $CONF CONFIG+=debug
#lupdate $CONF
#lrelease $CONF
make -j$JOBS
# default to 2 jobs or use the -j value given as argument to this script
make -j2 "$@"
}
if [ "$1" == "clean" ]; then