Skip to content

Commit

Permalink
Update buildinstructions_qt5.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
thurask committed Dec 5, 2020
1 parent 7ff5f09 commit 9c8d21b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions buildinstructions_qt5.txt
@@ -1,5 +1,6 @@
https://stackoverflow.com/questions/14932315/how-to-compile-qt-5-under-windows-or-linux-32-or-64-bit-static-or-dynamic-on-v
https://stackoverflow.com/questions/15826893/building-qt5-with-visual-studio-2012-visual-studio-2013-and-integrating-with/15893226#15893226
https://stackoverflow.com/questions/51278611/how-to-make-qt-static-build-run-without-install-vc-redist-x64-exe

If something breaks, read this instead:
https://github.com/qbittorrent/qBittorrent/wiki/Compiling-with-MSVC-2019-(static-linkage)
Expand All @@ -11,6 +12,7 @@ REQUIRED:
-MSVC2019
-Windows 10 SDK
-jom
For actually building a full-fledged Qt install, grab the other necessary requirements listed here: https://doc.qt.io/qt-5/windows-requirements.html

With everything in the path, open MSVC2019 prompt (VS2019 Command Prompt of choice; I'm using x64_x86 Cross Tools Command Prompt for VS 2019):
$mkdir C:\Qt5
Expand All @@ -20,19 +22,17 @@ $cd qt5
$git checkout <branch> (ex. 5.15.2, whatever)
$perl ./init-repository

Edit qmakespec (qtbase\mkspecs\common\msvc-desktop.conf)
QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_OPTIMIZE -MT
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -Zi -MT
QMAKE_CFLAGS_DEBUG = -Zi -MTd

Set env vars in prompt
Set env vars in prompt:
$set QTDIR=C:\Qt5\qt5
$set PATH=C:\Qt5\qt5\qtbase\bin;%PATH%

Build it
$configure -release -opensource -platform win32-msvc -static -nomake examples -nomake tests
Build it:
$configure -release -opensource -platform win32-msvc -static -static-runtime -nomake examples -nomake tests

If you want to build just tools (i.e. Linguist), make sure to -skip any top level folder other than qttools and qtbase:
$configure -release -opensource -platform win32-msvc -static -static-runtime -nomake examples -nomake tests -skip qtquickcontrols -skip qtwebchannel -skip qtactiveqt -skip qtandroidextras -skip qtdeclarative -skip qtimageformats -skip qtmacextras -skip qtserialport -skip qtx11extras -skip qtxmlpatterns -skip qtconnectivity -skip qtdoc -skip qtgraphicaleffects -skip qtlocation -skip qtmultimedia -skip qtsensors -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwinextras

Either
In any case, after configuration:
$nmake
or
$jom -j[number of jobs]
Expand Down

0 comments on commit 9c8d21b

Please sign in to comment.