You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When specifying a toolset name in CMakePresets.json, the correct toolset version is selected when using Visual Studio generators but not Ninja Generators.
I have both VS 2017 and VS 2019 installed on my computer. I'm using the following preset:
[preset] Configure preset Ninja: No toolset version specified for cl.exe, using latest by default
[preset] Using developer environment from Visual Studio (instance 59fddfac, version 16.11.31729.503, installed at "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional")
And the toolset with version 14.29.30133 is used. This corresponds to v142, not v141. Using the same configuration with a Visual Studio Generator selects the correct toolset version (14.16.XXX for v141).
Pull request #2366 allows us to specify the toolset version directly as part of the toolset string, which can be used to select the correct version. If I use "toolset": { "value": "v141,version=14.16.27023,host=x64", "strategy": "external" } then the 14.16.27023 toolset is correctly selected. However, only specifying the toolset name should also be supported.
Djoulihen
changed the title
Setting only the VS toolset name in CMakePresets.json does not work for Ninja generators
Setting only the VS toolset name in CMakePresets.json does not select the correct toolset for Ninja generators
Mar 12, 2022
Thanks for opening an issue to track this. The current workaround is to specify the version in the string as well (a two-part version number is sufficient).
For those running into the same issue:
You can find the version number by opening the Developer Command Prompt for the desired MSVC version
and running echo %VCToolsVersion%.
When specifying a toolset name in CMakePresets.json, the correct toolset version is selected when using Visual Studio generators but not Ninja Generators.
I have both VS 2017 and VS 2019 installed on my computer. I'm using the following preset:
When running the cmake configuration, I get:
And the toolset with version 14.29.30133 is used. This corresponds to v142, not v141. Using the same configuration with a Visual Studio Generator selects the correct toolset version (14.16.XXX for v141).
Pull request #2366 allows us to specify the toolset version directly as part of the toolset string, which can be used to select the correct version. If I use
"toolset": { "value": "v141,version=14.16.27023,host=x64", "strategy": "external" }
then the 14.16.27023 toolset is correctly selected. However, only specifying the toolset name should also be supported.See #1965 for more context about this issue.
The text was updated successfully, but these errors were encountered: