microsoft / microsoft/vscode-cmake-tools

Mechanism for restricting build variants to a valid set

Open
#4,080 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Feature: variants
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

### 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](https://vector-of-bool.github.io/docs/vscode-cmake-tools/variants.html), 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

```shell
N/A
```

### Debug Log

```shell
N/A
```

### Additional Information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the cmake-variants.yaml configuration and the variants documentation linked in the issue. Review how build options are currently presented, then define the validVariants format and its expected behavior for combinations. Done means invalid permutations are excluded from the user-facing variant list without changing valid variants.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, typescript
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.