是否可以从 Visual Studio 2010 项目并行编译 Qt 的 MOC 和 UI 文件?
我是否必须在特定于 qmake 的 make 文件上使用 jom 执行并行构建,而不是为项目中的每个 UI/MOC 文件添加自定义构建工具命令?
使用/MP 标志不会并行编译 MOC 和 UI 文件,因为它们使用自定义构建工具。仅同时调用标准编译器
最佳答案
引自 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.
关于visual-studio-2010 - 在 Visual Studio 2010 上并行编译 Qt MOC 和 UI 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5462415/