开发者

How do I get VisualStudio 2010 to use more than one processor core when compiling?

开发者 https://www.devze.com 2023-01-14 17:59 出处:网络
My workstation has an AMD Phenom II x6, 4GB DDR开发者_StackOverflow中文版3 ram, and Windows XP 32-bit (yes, still XP and still 32 bit).

My workstation has an AMD Phenom II x6, 4GB DDR开发者_StackOverflow中文版3 ram, and Windows XP 32-bit (yes, still XP and still 32 bit).

When I am compiling projects using VS2010, I've noticed that it doesn't use more than 1 core (at least this is what task manager is telling me).

Is there a way to get it to compile the individual files using multiple cores? -- Or is it XP?

Thanks in advance for any answers.

Edit:

Damien pointed me to this link regarding the /MP option for C++ projects.


MSBUild can use multiple processes, which can compile separate projects in parallel (see the /maxcpucount switch), but there's no ability as yet for the compilers (other than the C++ one) to use multiple processes within a single project.


I don't think this is directly possible.

However, there are some alternative solutions:

  • Write your own compiler front end. It should look up the files that need to be compiled, and then spawns multiple compiler processes. This approach seems strange, but we have done this (mainly because we switched between different platforms over the last 15 years and we wanted a consistent, multi-platform build-process)
  • Consider applications like Electric Build or Incredibuild. They can even spread your compilations over multiple machines. It's like having 20 cores in your machine.
0

精彩评论

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

关注公众号