Commit eff8bdea authored by Leander Schulten's avatar Leander Schulten

Fix build for gitlab CI and macOS build

parent 9d82ea33
Pipeline #288087 passed with stage
in 10 minutes and 37 seconds
image: registry.git.rwth-aachen.de/leander.schulten/lichtsteuerung/build_qt_5_13_0:latest
image: registry.git.rwth-aachen.de/leander.schulten/lichtsteuerung/build_qt_5_15_0:latest
stages:
- build
......
......@@ -155,6 +155,8 @@ RUN make qtquickcontrols2
RUN make qtserialport
RUN make qttools
RUN make qtwebsockets
RUN make zlib
RUN make quazip
#set path to mxe compiler
RUN export PATH=/usr/src/mxe/usr/bin:$PATH
......@@ -299,12 +299,19 @@ LIBS += -L$$PWD/lib/qtmqtt/lib -lQt5Mqtt
# QuaZip
GITLAB_CI=$$(GITLAB_CI)
!isEmpty(GITLAB_CI){
# in the gitlab CI quazip and zlib is build by mxe
LIBS += -L/usr/src/mxe/usr/x86_64-w64-mingw32.shared.posix/bin
LIBS += -lquazip -lzlib1
}else{
INCLUDEPATH += $$PWD/lib/quazip/dist/include
LIBS += -L$$PWD/lib/quazip/dist/bin -lQt5Quazip1
win32 {
LIBS += -L$$PWD/lib/quazip/zlib_windows/bin -lzlib1
} else {
LIBS += -lz
win32 {
LIBS += -L$$PWD/lib/quazip/dist/bin -lQt5Quazip1
LIBS += -L$$PWD/lib/quazip/zlib_windows/bin -lzlib1
} else { # macOS and linux
LIBS += -L$$PWD/lib/quazip/dist/lib -lQt5Quazip
LIBS += -lz
}
}
#!/bin/bash
set -e
set -o xtrace
cd $(dirname "$0")
source ./scripts/set_env.sh
......
......@@ -3,10 +3,15 @@ set -e
# set -o xtrace to debug commands
# see https://stachenov.github.io/quazip/
if ! [[ -z "$GITLAB_CI" ]];then
# in the ci we can skip this step because quazip is already installed via mxe
exit 0
fi
source ../scripts/set_env.sh
# if we are on windows, we first have to build zlib
if [[ "$OSTYPE" == "msys" ]] || ! [[ -z "$GITLAB_CI" ]]; then
if [[ "$OSTYPE" == "msys" ]]; then
cd zlib_windows
./build_windows.sh
cd ..
......@@ -18,7 +23,7 @@ GIT_DIR=quazip
cd $GIT_DIR
# we are in the "$GIT_DIR" now
if [[ "$OSTYPE" == "msys" ]] || ! [[ -z "$GITLAB_CI" ]]; then
if [[ "$OSTYPE" == "msys" ]]; then
qmakeOptions=("LIBS += -L'\$\$PWD/../../zlib_windows/bin' -lzlib1" "INCLUDEPATH += '\$\$PWD../../zlib_windows/include'" PREFIX=../../dist quazip.pro)
else
qmakeOptions=("LIBS += -lz" PREFIX=../../dist quazip.pro)
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -45,12 +45,11 @@ else
exit 1
fi
fi
export QT_LATEST="$LATEST"
BUILD=$(ls "$QT/$LATEST/" | grep _64)
export QT_LATEST="$LATEST"
# on windows we have to set the path to use the right compiler
if [[ "$OSTYPE" == "msys" ]];then
BUILD=$(ls "$QT/$LATEST/" | grep _64)
compilerDir=$(echo $BUILD | sed s/_/0_/ ) # build is e.g. mingw73_64, but the compiler dir is than mingw730_64
export PATH="$QT\\$LATEST\\$BUILD\\bin;$QT\\Tools\\$compilerDir\\bin;$PATH"
QT_N=$(echo $QT | sed 's/\\/\//' ) # here we need normal slashed, but in path backslashes -.-
......@@ -62,11 +61,12 @@ fi
if [ ! -z "$GITLAB_CI" ]; then # in gitlab CI
qmake=/usr/src/mxe/usr/x86_64-w64-mingw32.shared.posix/qt5/bin/qmake
else
BUILD=$(ls "$QT/$LATEST/" | grep _64)
qmake="$QT/$LATEST/$BUILD/bin/qmake"
fi
export qmake=$qmake
if [[ "$OSTYPE" == "msys" ]] || ! [[ -z "$GITLAB_CI" ]]; then
if [[ "$OSTYPE" == "msys" ]]; then
make="mingw32-make.exe"
else
make="make"
......
......@@ -26,7 +26,7 @@ mkdir -p release
cd release
# build
if [[ "$OSTYPE" == "msys" ]] || ! [[ -z "$GITLAB_CI" ]]; then
if [[ "$OSTYPE" == "msys" ]]; then
# we are on windows
# from build_mingw_release.bat
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release ../lib
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment