Presets use NUMBER_OF_PROCESSORS for number of parallel jobs

Hey guys,
I’m starting to use the CMakePresets.json
Now for the TestPresets and the BuildPresets we can specify an optional number of build jobs.
I’d like to run all build with the current number of available processors

  "buildPresets": [
      "name": "_default_build",
      "hidden": true,
      "jobs": 12

now If i replace “jobs”: 12 with “jobs”: $env{NUMBER_OF_PROCESSORS}
VS2022 shows a warning that the value of jobs must be an integer.

How can I use the value of NUMBER_OF_PROCESSORS for the build presets and test presets?

@kyle.edwards Is this possible?

I suspect that 0 might be the answer, but I forget if that is “count the processors” or make's “don’t count anything, just keep launching commands” (hopefully the former as the latter is just a complicated forkbomb in practice).

The jobs field is supposed to be an integer, not a string. Unfortunately, that precludes the use of environment variables.

Thank you both for your feedback. I did a little test after Ben’s feedback. For me it looks like job number = 0 feels like j=1 for Makefiles and Ninja

I’ll add this as a feature request though :slight_smile: