forked from MercerWeiss/SilentDragon
-
Notifications
You must be signed in to change notification settings - Fork 14
/
win-build.sh
executable file
·46 lines (40 loc) · 961 Bytes
/
win-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# Copyright 2019-2020 The Hush Developers
# Released under the GPLv3
# This script will cross-compile windoze binaries, hopefully!
set -e
UNAME=$(uname)
if [ "$UNAME" == "Linux" ] ; then
JOBS=$(nproc)
elif [ "$UNAME" == "FreeBSD" ] ; then
JOBS=$(nproc)
elif [ "$UNAME" == "Darwin" ] ; then
JOBS=$(sysctl -n hw.ncpu)
else
JOBS=1
fi
VERSION=$(cat src/version.h |cut -d\" -f2)
echo "Compiling SilentDragon $VERSION with $JOBS threads..."
CONF=silentdragon.pro
qbuild () {
x86_64-w64-mingw32.static-qmake-qt5 $CONF CONFIG+=debug
make -j$JOBS
}
qbuild_release () {
# This binary must be in your PATH!
x86_64-w64-mingw32.static-qmake-qt5 $CONF CONFIG+=release
make -j$JOBS
}
if [ "$1" == "clean" ]; then
make clean
elif [ "$1" == "linguist" ]; then
lupdate $CONF
lrelease $CONF
elif [ "$1" == "cleanbuild" ]; then
make clean
qbuild
elif [ "$1" == "release" ]; then
qbuild_release
else
qbuild
fi