-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_mingw32
executable file
·41 lines (35 loc) · 1.59 KB
/
build_mingw32
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
#!/bin/bash
TARGET="i686-w64-mingw32"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKSPACE=${WORKSPACE:-$SCRIPT_DIR}
BUILD_DIR="$WORKSPACE/build/build/$TARGET"
DIST_DIR="$WORKSPACE/build/dist/$TARGET"
ARTIFACTS_DIR="$WORKSPACE/build/artifacts/mingw32"
TIMESTAMP=`date +%Y%m%d`
BUILD_ID=${BUILD_ID:-$TIMESTAMP}
CACHE_DIR="$WORKSPACE/build/cache/mingw32"
CCACHE_DIR="$CACHE_DIR/ccache"
die() {
echo "Error:" $@
echo "Make sure your sources are compilable and run this script only in qt5-build-environment-mingw container."
exit -1
}
cd "$WORKSPACE"
rm -rf "$BUILD_DIR"
rm -rf "$DIST_DIR"
rm -rf "$ARTIFACTS_DIR"
mkdir -p "$CCACHE_DIR"
mkdir -p "$BUILD_DIR"
mkdir -p "$ARTIFACTS_DIR"
cd $BUILD_DIR
$TARGET-cmake -DCMAKE_INSTALL_PREFIX=$DIST_DIR -DCMAKE_BUILD_TYPE=MinSizeRel -DVERSION_FROM_GIT=true $WORKSPACE || die "Unable to configure the program"
make -j`nproc` || die "Unable to build the program"
make install
$WORKSPACE/thirdparty/mxedeployqt/mxedeployqt --qtplugins="iconengines;imageformats;platforminputcontexts;platforms;sqldrivers;styles" \
--skiplibs="qsqlmysql.dll;qsqlodbc.dll;qsqlpsql.dll;qsqltds.dll" \
--additionallibs="libwinpthread-1.dll;icudt56.dll;icuin56.dll;icuuc56.dll" \
--mxepath=/usr/ --mxetarget $TARGET --qmlrootpath=$WORKSPACE/src/qml $DIST_DIR || die "Unable to bundle the needed libraries"
cd "$ARTIFACTS_DIR"
cp "$BUILD_DIR/installer.nsis" .
makensis -V4 "installer.nsis" || die "Unable to create installer"
rm "installer.nsis"