Allow custom number of cores to compile via build.sh #137
This commit is contained in:
@@ -66,7 +66,10 @@ Compiling can take some time, so be patient and wait for it to finish. It will t
|
|||||||
git clone https://git.hush.is/hush/SilentDragonLite
|
git clone https://git.hush.is/hush/SilentDragonLite
|
||||||
cd SilentDragonLite
|
cd SilentDragonLite
|
||||||
./build.sh linguist
|
./build.sh linguist
|
||||||
|
# This defaults to using 2 cores to compile
|
||||||
./build.sh
|
./build.sh
|
||||||
|
# To use a custom number of cores to compile, such as 8 :
|
||||||
|
# ./build.sh -j8
|
||||||
./SilentDragonLite
|
./SilentDragonLite
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
15
build.sh
15
build.sh
@@ -4,16 +4,6 @@
|
|||||||
|
|
||||||
UNAME=$(uname)
|
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
|
# check if rustc and cargo are installed, otherwise exit with error
|
||||||
if ! command -v rustc &> /dev/null
|
if ! command -v rustc &> /dev/null
|
||||||
then
|
then
|
||||||
@@ -40,7 +30,7 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
VERSION=$(cat src/version.h |cut -d\" -f2)
|
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
|
CONF=silentdragon-lite.pro
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@@ -48,7 +38,8 @@ qbuild () {
|
|||||||
qmake $CONF CONFIG+=debug
|
qmake $CONF CONFIG+=debug
|
||||||
#lupdate $CONF
|
#lupdate $CONF
|
||||||
#lrelease $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
|
if [ "$1" == "clean" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user