首页 > 其他 > 详细

Qt5 源代码裁剪编译

时间:2016-01-18 22:22:57      阅读:1164      评论:0      收藏:0      [点我收藏+]

目的

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/configure-options.html Qt5 configure 的配置方法
 
 
(暂且写得比较精简,有机会再补充详细)

 

Qt5 源代码裁剪编译

原文:http://www.cnblogs.com/rhzhang/p/5140404.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!