提高VS2010/VS2012编译速度 除了合理的划分模块,减少link的时间外,充分利用多核编译也很重要。

提高VS2010/VS2012编译速度
除了合理的划分模块,减少link的时间外,充分利用多核编译也很重要。

VS2010/2012都可以用多核编译,需要同时设置如下两个参数:

Enable Minimal Rebuild  

Properties -> Configuration Properties -> C/C++ -> Code Generation -> Enable Minimal Rebuild -> No(/Gm-)

默认情况下该参数在Debug模式下为Yes,而在Release下为No。

Multi-processor Compilation 

Properties -> Configuration Properties -> C/C++ -> Geneal -> Multi-processor Compilation -> Yes(/MP)

默认情况下Debug/Release均未设置。

在全局参数中可以设置最大并行project的数目。默认情况下该参数有系统的“核”数决定。如i7 CPU默认为8。

Options->Projects and Solutions->Build and Run:

8 maximum number of parallel project builds.