Qt5 源代碼裁剪編譯


目的

1. 學習Qt5框架

2. 學習 VC++ 命令行工具鏈

 

本文編譯環境

1. Windows 10(64-bit)

2. Visual Studio 2013 Express (with Update 4)

3. qt-everywhere-opensource-src-5.4.1.7z (源代碼)

4. Perl: ActivePerl-5.20.1.2000-MSWin32-x86-64int-298557.msi

5. Python: python-2.7.9.msi

6. Ruby: rubyinstaller-1.9.3.p551.exe

 

步驟

0. 先查看一下 configure 的選項:configure -help 

其中常用選項如下:

-debug 只編譯出 debug 版本,是默認選項(相對於 -release 選項)
-debug-and-release 兩種版本都編譯
-opensource 使用 opensource 版本的Qt(相對於 -commercial 選項)
-c++11 打開 C++11 的支持
-shared 使用共享庫,是默認選項(相對於 -static 選項)
-skip <module> 移除某模塊
-make <part> 添加編譯的部分:libs, tools, examples (相對於 -nomake)
-iconv 開啟 iconv 的支持
-mp MSVC 多進程編譯加速
-developer-build  Compile and link Qt with Qt developer options (including auto-tests exporting)
-no-openssl 不編譯 openssl
-no-iconv 不編譯 iconv
-no-qml-debug 不編譯 qml debug 的支持
 
1. 使用編譯選項
configure -opensource -platform win32-msvc2013 -developer-build -mp -nomake examples -nomake tests -no-icu -no-openssl  -no-iconv -no-qml-debug -skip qtactiveqt -skip qtconnectivity -skip qtdeclarative -skip qtdoc -skip qtenginio -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtquick1 -skip qtquickcontrols -skip qtscript -skip qtsensors -skip qtserialport -skip qtsvg -skip qttools -skip qttranslations -skip qtwebchannel -skip qtwebengine -skip qtwebkit -skip qtwebkit-examples -skip qtwebsockets -skip qtxmlpatterns
 
2. 編譯並安裝
nmake && nmake install
 

參考資料

·  http://doc.qt.io/qt-5/qtmodules.html Qt5 的模塊列表
·  http://doc.qt.io/qt-5/configure-options.html Qt5 configure 的配置方法
 
 
(暫且寫得比較精簡,有機會再補充詳細)

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM