From 48db261e69c37cd9504c27dcee952d651f7ac43b Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 16 Nov 2022 09:38:41 -0500 Subject: cmake --build: Use both inter- and intra-project parallelism with msbuild Since commit 1ab3881ec9 (cmake: Add options for parallel builds to --build mode, 2018-04-14, v3.12.0-rc1~42^2), `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 --- Source/cmGlobalVisualStudio10Generator.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index d6d808d..266e08d 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -1155,8 +1155,6 @@ cmGlobalVisualStudio10Generator::GenerateBuildCommand( } else { makeCommand.Add(cmStrCat("/m:", std::to_string(jobs))); } - // Having msbuild.exe and cl.exe using multiple jobs is discouraged - makeCommand.Add("/p:CL_MPCount=1"); } // Respect the verbosity: 'n' normal will show build commands -- cgit v0.12