Parallel compilation for projects with dependencies on each other in Visual studio

前端 未结 1 984
走了就别回头了
走了就别回头了 2021-01-17 02:15

In my company we are using Visual Studio 2013 and we would like to reduce the build times of our C++ solution. It is about 55 projects and it takes roughly 20 minutes for a

相关标签:
1条回答
  • 2021-01-17 02:45

    The C++ compiler switch /MP is for compiling cpp files in parallel. This is on a per project basis. This will not however get all the projects to build in parallel. To do that you have to pass in -M[:num] or -maxcpucount (max cpu count) to msbuild.exe. (see https://msdn.microsoft.com/en-us/library/ms164311.aspx for details)

    In answer to your first question: "if there is a way to make projects with dependencies on each other compile in parallel". The answer is kinda. If the two projects that depend on each other, are in a solution and the dependencies between each other are clearly marked, then the cpp files can compile simultaneously, but not link simultaneously. The linking must occur in order of how they depend on one another.

    So in general you want as few dependencies as possible between your projects if you want to make things compile faster. But there are other ways to make C++ compile faster.

    As for VS 2017, Run don't Walk to upgrade.

    0 讨论(0)
提交回复
热议问题