简约 Qt 构建的推荐标志

发布于 2024-10-31 11:44:48 字数 1166 浏览 4 评论 0原文

我正在尝试构建 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 编译为静态

  1. 禁用调试:-release
  2. 禁用不需要的模块,尤其是 QtWebKit:-no-webkit -no-script -no-scripttools -no-qt3support -nomake 演示 -nomake 工具 -nomake 示例
  3. 禁用 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

  1. Disable debug: -release
  2. Disable modules you don't need, especially QtWebKit: -no-webkit
    -no-script -no-scripttools -no-qt3support -nomake demos -nomake tools -nomake examples
  3. Disable LTCG support, which has the nasty side effect of generating huge
    static libraries: no-ltcg

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦晓ヶ微光ヅ倾城 2024-11-07 11:44:48

那应该没问题。如果涉及到构建时间(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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文