开发者

How to shorten the Qt make process?

开发者 https://www.devze.com 2023-03-10 11:07 出处:网络
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

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, i开发者_开发知识库t 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?


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:

  1. -release or -debug: build only release or debug binaries
  2. -nomake demos, -nomake examples, -nomake tools: don't build well, demos, examples or tools.
  3. -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.


The one big library taking the longest is webkit. If you don't need webkit, you can pass

-no-webkit

and the build time should go down significantly. Most other flags (like -nomake demos, -nomake examples, see rubenvb's answer) are microoptimization in comparison.


I configure Qt to build vcproj files and then use vcbuild which supports multi-threaded builds, using /M4 or /M8 option:

/M<number> Specifies the number of concurrent builds to run, if possible

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.


Take a look at jom.

jom is a clone of nmake to support the execution of multiple independent commands in parallel. It adds the -j command line switch similar to GNU make.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号