准備工作提前安裝VS2019,然后安裝README文件中要求安裝依賴工具,說明如下
Windows:
--------
Open a command prompt.
Ensure that the following tools can be found in the path:
* Supported compiler (Visual Studio 2012 or later,
MinGW-builds gcc 4.9 or later)
* Perl version 5.12 or later [http://www.activestate.com/activeperl/]
* Python version 2.7 or later [http://www.activestate.com/activepython/]
* Ruby version 1.9.3 or later [http://rubyinstaller.org/]
cd <path>\<source_package>
configure -prefix %CD%\qtbase <license> -nomake tests
nmake // jom // mingw32-make
To accelerate the bootstrap of qmake with MSVC, it may be useful to pass
"-make-tool jom" on the configure command line. If you do not use jom,
adding "/MP" to the CL environment variable is a good idea.
More details follow.
Build!
1、解壓qt-everywhere-src-5.15.0到D盤
2、修改D:\qt-everywhere-src-5.15.0\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
3、打開x86 Native Tools Command Prompt for VS 2019 (建議管理員權限)
cd D:\qt-everywhere-src-5.15.0
D:
4、配置編譯參數
configure.bat -static -prefix "C:\Qt\5.15.0\msvc2019_static" -confirm-license -opensource -debug-and-release -platform win32-msvc -nomake examples -nomake tests -plugin-sql-sqlite -plugin-sql-odbc -qt-zlib -qt-libpng -qt-libjpeg -opengl desktop -mp
5、編譯和安裝,這里使用jom需要單獨安裝
D:\jom_1_1_3\jom.exe
D:\jom_1_1_3\jom.exe install
