Describe the bug
Conan erroneously passes tools.build:jobs (default CPU count) to the CMake buildPresets execution.jobs property, which CMake forwards to MSBuild as -maxCpuCount (aka /m), causing multiple MSBuild processes to be spawned.
However, this was supposed to be the job of tools.microsoft.msbuild:max_cpu_count. tools.build:jobs is supposed to map to parallelism by the compiler (cl.exe) via the /MP flag, which will cause it to spawn copies of itself when passed multiple source files within a target by MSBuild. This flag is passed via conan_toolchain.cmake.
When using CMake build presets, this means MSBuild's /m and cl.exe's /MP will stack, leading to tools.build:jobs^2 parallelism.
Originally noticed in #19384 (comment).
How to reproduce it
conan install on CMake project with Visual Studio generator
cmake --preset conan-debug
cmake --build --preset conan-debug
- Will erroneously spawn
tools.build:jobs MSBuild processes.
