如何缩短Qt make过程?
我已经下载了一个针对 Windows 的开源 Qt。由于我使用VS2010命令提示符进行安装,它自动将平台设置为msvc-2010。当我尝试使用 nmake 构建时,大约需要 7-8 小时才能完成安装。在此过程中,我注意到 Qt 正在编译我不需要的库,例如javascript。
由于我专注于桌面开发,我可以知道如何缩短构建过程吗?
I have downloaded an open source Qt that target on Windows. Since I am using the VS2010 command prompt to do the installation, it automatically set the platform to msvc-2010. When I am trying to build using nmake, it took about 7-8 hours to complete the installation. During the process, I have notice that Qt is compiling the libraries which I don't need like javascript.
May I know how can I shorten the build process since I am focusing on desktop development?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
正如@tibur所说,您可以使用
jom
,它是一种“并行nmake”。您还可以将多个选项传递给 Qt 的配置,其中一些是:-release
或-debug
:仅构建发布或调试二进制文件-nomake demos
、-nomake 示例
、-nomake 工具
:构建得不好,演示、示例或工具。-no-webkit
、-no-qt3support
、-no-script
、-no-scripttools
:禁用某些Qt 模块。可能还有更多,
configure.exe --help
会告诉您所有可用的选项。As @tibur said, you can use
jom
, which is a kind of "parallel nmake". You can also pass several options to Qt's configure, some of which are:-release
or-debug
: build only release or debug binaries-nomake demos
,-nomake examples
,-nomake tools
: don't build well, demos, examples or tools.-no-webkit
,-no-qt3support
,-no-script
,-no-scripttools
: disable certain Qt modules.There may be more,
configure.exe --help
will tell you all the options available to you.耗时最长的一个大型库是 webkit。如果您不需要 webkit,则可以通过
,并且构建时间应该会显着缩短。相比之下,大多数其他标志(例如 -nomake demos、-nomake 示例,请参阅 rubenvb 的答案)都是微优化。
The one big library taking the longest is webkit. If you don't need webkit, you can pass
and the build time should go down significantly. Most other flags (like -nomake demos, -nomake examples, see rubenvb's answer) are microoptimization in comparison.
我配置 Qt 来构建 vcproj 文件,然后使用支持多线程构建的
vcbuild
,使用 /M4 或 /M8 选项:您还可以使用
devenv.com
进行构建,如果您在 IDE 选项中进行了配置,则它会同时构建。显然,这两个都像
jom
,但无需安装其他任何东西即可工作。I configure Qt to build vcproj files and then use
vcbuild
which supports multi-threaded builds, using /M4 or /M8 option:You can also build with
devenv.com
which builds concurrently if you've configured that in your IDE options.Both of these are like
jom
, apparently, but this works w/o installing anything else.看看jom。
Take a look at jom.