Skip to content

cmake --build: Use both inter- and intra-project parallelism with msbuild

Brad King requested to merge brad.king/cmake:vs-build-parallel into master

Since !1962 (merged), cmake --build --parallel has added two options to the msbuild command line:

  • /m enables inter-project parallelism in msbuild.
  • /p:CL_MPCount=1 suppresses intra-project parallelism in cl.

The latter was used to avoid O(N^2) compilation threads on N processors. In practice however, projects often have many source files in a few targets, so --parallel actually reduces parallelism.

Drop the latter option to restore intra-project parallelism. Users can always add -- /p:CL_MPCount=1 themselves.

Fixes: #20564 (closed)

Merge request reports