|
|
@ -1,19 +1,9 @@ |
|
|
|
#!/bin/bash |
|
|
|
#!/usr/bin/env bash |
|
|
|
# Copyright 2019-2024 The Hush Developers |
|
|
|
# Released under the GPLv3 |
|
|
|
|
|
|
|
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 |
|
|
@ -39,8 +29,8 @@ then |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
|
|
|
|
VERSION=$(cat src/version.h |cut -d\" -f2) |
|
|
|
echo "Compiling SilentDragonLite $VERSION with $JOBS threads..." |
|
|
|
VERSION=$(grep APP_VERSION src/version.h |cut -d\" -f2) |
|
|
|
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 |
|
|
@ -58,7 +49,7 @@ elif [ "$1" == "linguist" ]; then |
|
|
|
lrelease $CONF |
|
|
|
elif [ "$1" == "cleanbuild" ]; then |
|
|
|
make clean |
|
|
|
qbuild |
|
|
|
qbuild "$@" |
|
|
|
else |
|
|
|
qbuild |
|
|
|
qbuild "$@" |
|
|
|
fi |
|
|
|