简约 Qt 构建的推荐标志
我正在尝试构建 Qt,因为 Visual Studio 2010 需要它。构建脚本 (configure.exe) 非常简单,但默认情况下需要很长时间才能编译。在配备 SSD 的快速笔记本电脑上等待了一个小时后,我放弃了(不使用标志,仅使用 configure.exe)。
对于基本的轻量级 Qt 应用程序,推荐的标志是什么?我的意思是对于学习 Qt 的人来说,他们不需要 WebKit 等。
我收集了我发现的最有用的链接:
Qt 配置的参考页面:http://doc.qt.io/qt-4.8/configure-options.html
本在这个问题中的建议:使用 Visual C++ 2010 构建 Qt 4.5
-no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-multimedia -no-qt3support -fast
Rubenvb对此问题的建议: 如何将 Qt 编译为静态
- 禁用调试:
-release
- 禁用不需要的模块,尤其是 QtWebKit:
-no-webkit -no-script -no-scripttools -no-qt3support -nomake 演示 -nomake 工具 -nomake 示例
- 禁用 LTCG 支持,这会产生巨大的副作用 静态库:
no-ltcg
I am trying to build Qt because it is required for Visual Studio 2010. The build script (configure.exe) is quite straightforward but by default it takes ages to compile. After waiting for an hour on a fast notebook with an SSD, I've given up (using no flags, just configure.exe).
What are the recommended flags for a basic, lightweight Qt application? I mean for someone learning Qt, who doesn't need WebKit and so on.
I've collected the most useful links I found:
The reference page for Qt configure: http://doc.qt.io/qt-4.8/configure-options.html
Ben's advice from this question: Building Qt 4.5 with Visual C++ 2010
-no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-multimedia -no-qt3support -fast
Rubenvb's advice from this question: How to compile Qt as static
- Disable debug:
-release
- Disable modules you don't need, especially QtWebKit:
-no-webkit
-no-script -no-scripttools -no-qt3support -nomake demos -nomake tools -nomake examples- Disable LTCG support, which has the nasty side effect of generating huge
static libraries:no-ltcg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那应该没问题。如果涉及到构建时间(webkit 是巨大的),除了 webkit 之外的一切都只是微优化。当您想探索 Qt 时,我不会设置 -nomake 工具,因为您可能想使用这些工具。
That should be ok. Everything beyond webkit is just micro-optimization, if it comes to build times (webkit is huge). I wouldn't set -nomake tools when you want to explore Qt, as you might want to use those tools.