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

 

转载于:https://www.cnblogs.com/rhzhang/p/5140404.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值