microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.48k stars 454 forks source link

Mechanism for restricting build variants to a valid set #4080

Open WiseCrohn opened 2 months ago

WiseCrohn commented 2 months ago

Brief Issue Summary

Hi, this is a suggestion for a new feature which I feel would be really useful. The build options in cmake-variants.yaml are permuted to produce all the variants presented in the drop-down. As you mention here, the number of variants grows very large for a project with a few options. But often, in some projects there are often only a few valid variants. It would be really useful to be able to only present these valid ones to the user. Could there be an option within cmake-variants.yaml to list valid variants, perhaps an additional entry such as validVariants?

If this was felt to be a good idea, I would be happy to have a go at coding this myself.

CMake Tools Diagnostics

N/A

Debug Log

N/A

Additional Information

No response