feat: support vsInstanceVersion vendor field for Ninja presets - #5004
Open
Omotola wants to merge 2 commits into
Open
feat: support vsInstanceVersion vendor field for Ninja presets#5004Omotola wants to merge 2 commits into
Omotola wants to merge 2 commits into
Conversation
Allow users to specify a preferred Visual Studio major version in
CMakePresets.json vendor settings, enabling VS instance selection for
Ninja generator presets without hardcoding installation paths.
Example preset configuration:
{
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"vsInstanceVersion": 17
}
}
}
This picks the VS2022 (major version 17) dev environment even when
VS2026 (major version 18) is also installed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e55cc9b5-dc8d-413d-a219-8c6418ec1d25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4698
When multiple VS versions are installed, the extension always picks the latest one for Ninja presets. This adds a
vsInstanceVersionvendor field so users can pin a specific VS major version without hardcoding paths.The value is just the major version number (17 = VS2022, 18 = VS2026). Example:
{ "name": "ninja-vs2022", "generator": "Ninja", "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "vsInstanceVersion": 17 } } }Tested on a machine with both VS2022 and VS2026 installed - correctly picks the specified version and displays it in the configure log

After Change