From 68d9388c1b87139d00fcc10ce94dd7a2109fdced Mon Sep 17 00:00:00 2001 From: Duke Date: Sat, 20 Jan 2024 13:01:18 -0500 Subject: [PATCH] Check for valid QT versions or bail early --- build.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index c648fed..8abfeb7 100755 --- a/build.sh +++ b/build.sh @@ -30,7 +30,21 @@ then fi VERSION=$(grep APP_VERSION src/version.h |cut -d\" -f2) -echo "Compiling SilentDragonLite $VERSION on $UNAME with args=$@" +QTVERSION=$(qmake --version | tail -n 1 | cut -d' ' -f4) +QT_MAJOR_VERSION=$(echo $QTVERSION | cut -d. -f1) +QT_SUB_VERSION=$(echo $QTVERSION | cut -d. -f2) + +if [ "$QT_MAJOR_VERSION" != "5" ]; then + echo "Your QT version $QTVERSION is not compatible, only QT 5.x is supported" + exit 1 +fi + +if [ "$QT_SUB_VERSION" -lt "12" ]; then + echo "Your QT version $QTVERSION is not compatible, at least QT 5.12.0 is required" + exit 1 +fi + +echo "Compiling SilentDragonLite $VERSION on $UNAME with QT $QTVERSION and args=$@" CONF=silentdragon-lite.pro set -e