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 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.
链接地址: http://www.djcxy.com/p/78986.html