qt.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. # Build Qt
  3. set -e
  4. if [ $1 == "release" ]; then
  5. OPTIONS="-static"
  6. else
  7. OPTIONS=""
  8. fi
  9. CORES=$(getconf _NPROCESSORS_ONLN)
  10. JOBS=$(($CORES-1))
  11. BASEDIR=$PWD/thirdparty/qt
  12. DEPLOYDIR=$BASEDIR/install
  13. QT_MAJOR=6
  14. QT_MINOR=1
  15. QT_BUGFIX=0
  16. URL="https://download.qt.io/official_releases/qt/$QT_MAJOR.$QT_MINOR/$QT_MAJOR.$QT_MINOR.$QT_BUGFIX/single/qt-everywhere-src-$QT_MAJOR.$QT_MINOR.$QT_BUGFIX.tar.xz"
  17. mkdir -p $BASEDIR
  18. if [ -d $DEPLOYDIR ]; then
  19. rm -rf $DEPLOYDIR
  20. fi
  21. mkdir -p $DEPLOYDIR
  22. pushd $BASEDIR
  23. if [ ! -f qt-everywhere-src-$QT_MAJOR.$QT_MINOR.$QT_BUGFIX.tar.xz ]; then
  24. wget $URL
  25. fi
  26. if [ -d "qt-everywhere-src-$QT_MAJOR.$QT_MINOR.$QT_BUGFIX" ]; then
  27. rm -rf "qt-everywhere-src-$QT_MAJOR.$QT_MINOR.$QT_BUGFIX"
  28. fi
  29. tar -xf "qt-everywhere-src-$QT_MAJOR.$QT_MINOR.$QT_BUGFIX.tar.xz"
  30. pushd "qt-everywhere-src-$QT_MAJOR.$QT_MINOR.$QT_BUGFIX"
  31. ./configure $OPTIONS -ltcg -optimize-size -no-pch -prefix $DEPLOYDIR -release -opensource -confirm-license \
  32. -nomake examples -nomake tests -nomake tools \
  33. -skip qtscxml -skip qtwayland -skip qtdatavis3d -skip qtcharts \
  34. -skip qtquickcontrols2 -skip qtvirtualkeyboard -skip qtshadertools \
  35. -skip qttranslations -skip qtdoc -skip qt3d -skip qtnetworkauth \
  36. -skip qt5compat -skip qtcoap -skip qtlottie -skip qtmqtt \
  37. -skip qtopcua -skip qtquick3d -skip qtquicktimeline -skip qttools \
  38. -skip qtdeclarative -skip qtactiveqt
  39. cmake --build . --parallel $JOBS
  40. cmake --install .
  41. popd