configure -prefix D:\Qt\NewStatic -platform win32-msvc -opensource -debug-and-release -confirm-license -opengl dynamic -mp -static -static-runtime -no-shared -qt-libpng -qt-libjpeg -qt-zlib -qt-pcre -no-compile-examples -nomake examples -no-icu -optimize-size -openssl-linked OPENSSL_PREFIX=C:\Qt\5.14.1\msvc2019-x86-static\openssl-1.1.1d
//openssl目录选择到 能看到include lib bin 就好
C:\Qt\5.14.1\msvc2019-x86-static\openssl-1.1.1d\include
C:\Qt\5.14.1\msvc2019-x86-static\openssl-1.1.1d\bin
C:\Qt\5.14.1\msvc2019-x86-static\openssl-1.1.1d\lib
configure中的参数
OPENSSL_PREFIX=C:\Qt\5.14.1\msvc2019-x86-static\openssl-1.1.1d
就好了
剩下
nmake
nmake install
具体编译参数 可以用configure -help查看
-debug-and-release //编译模式
-opensource //开源协议
-mp //多线程编译
-static -static-runtime//静态
//静态编译需要修改
Src\qtbase\mkspecs\common下的
msvc-desktop.conf
MD改成MT
QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_OPTIMIZE -MT
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -Zi -MT
QMAKE_CFLAGS_DEBUG = -Zi -MTd
//ps:推荐大神的Qt5编译脚本
链接
configure -prefix D:\MYSDK\QT5 -platform win32-msvc -opensource -debug-and-release -confirm-license -mp -static -static-runtime -nomake examples -no-icu -optimize-size -skip qt3d -skip qtscript -skip qtmultimedia -skip qttools -skip qttranslations -skip qtwebsockets -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtdatavis3d -skip qtcharts -skip qtpurchasing