Using a single build preset with multiple configuration presets?

I use Ninja, and sometimes want to use a build option like this:

“buildPresets”: [
“name”: “ninja_list_all_errors”,
// ninja option meaning build and don’t stop on first failure
// -k N keep going until N jobs fail (0 means infinity) [default=1]
“nativeToolOptions”: [“-k”, “0”]

Naturally I’d like to be able to run this option with any of my existing configure presets since it’s orthogonal to the rest of the project configuration.

However, it seems that any buildPreset needs a configurePreset, either directly or indirectly.
And, the vs-code CMake plugin enforces this - once you have selected a configurePreset it is not possible to pick a build preset that doesn’t specify that configure preset.

I suspect maybe I’m just missing something, but is there a way to accomplish this?


This is a much discussed limitation of presets, as currently implemented. You may want to follow any discussion or progress in the following issue:

thanks for the pointer and confirming so I can stop trying. :slight_smile: