开发者

Compile Qt MOC and UI files in parallel on Visual Studio 2010

Is it possible to compile Qt's MOC and UI files in parallel from a Visual Studio 2010 project?

Do I have to perform a parallel build with jom on a qmake-specific make file, rather than add a custom build tool command开发者_JS百科 for every UI/MOC file in the project?

Using the /MP flag does not compile the MOC and UI files in parallel, as they use a Custom Build Tool. Only the standard compiler is invoked concurrently


Quoting from Qt4 with Visual Studio: Multicore Processors:

Multicore processors

If you have a multicore processor and VS 2008 Express or higher you can build programs on all cores.

Visual C++ 2008’s /MP flag tells the compiler to compile files in the same project in parallel. I typically get linear speedups on the compile phase. The link phase is still sequential, but on most projects compilation dominates.

Add these line to the .pro file for release version:

QMAKE_CXXFLAGS_RELEASE += -MP[processMax] Then rebuild the application.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜