#19405·conan

[bug] CMake build preset with Visual Studio spawns MSBuild processes according to `tools.build:jobs`

Author: stevenwdvCreated Dec 19, 2025Updated Sep 28, 2026
Labelsstage: triaging

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 https://github.com/conan-io/conan/issues/19384#issuecomment-3655519631.

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.
many MSBuild.exe + cl.exe