Skip to content

[question] toolset v143 in CMakePresets.json while the libraries are built with vcvars_ver=14.4, why? #18285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task
artem-kamyshev opened this issue May 11, 2025 · 1 comment
Assignees

Comments

@artem-kamyshev
Copy link

What is your question?

Hello,
I want to build my project with newest MS VS 2022.
I use Ninja to build it.

I use myown CMakePreset.json but it lacks PATH env setup which is done for conan-debug preset. While thinking on switching to the one generated by conan I see

            "toolset": {
                "value": "v143",
                "strategy": "external"
            },

This does not seem right, as my MS VS 2022 is of Version 17.13.6. Looking at https://learn.microsoft.com/en-us/cpp/overview/compiler-versions?view=msvc-170 we see that compiler version is 1944. And as written in https://devblogs.microsoft.com/cppblog/msvc-toolset-minor-version-number-14-40-in-vs-2022-v17-10/ I assume the right and latest toolset should be v144:

Custom build systems, projects, libraries, and VS Extensions checking for valid MSVC build version will need to be adjusted to allow for ‘14.4x’.

I have both v143 and 14.42.34433 in c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC.
c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt contains 14.43.34808.

My conan profile for building the depedencies is the following:

[settings]
arch=x86_64
build_type=Debug
compiler=msvc
compiler.cppstd=17
compiler.runtime=dynamic
compiler.version=194
os=Windows

[conf]
tools.cmake.cmaketoolchain:generator=Ninja
tools.env.virtualenv:powershell=powershell.exe
tools.microsoft.msbuild:installation_path=C:\Program Files\Microsoft Visual Studio\2022\Community\
tools.microsoft.msbuild:vs_version=17
tools.microsoft:winsdk_version=10.0.22621.0

As I see the following line during the build of the conan packages

conanvcvars.bat: Activating environment Visual Studio 17 - amd64 - winsdk_version=10.0.22621.0 - vcvars_ver=14.4

I assume it should use v144, but when I look at the generated CMakePresets.json I see 144 in it.

I've read something like them being compatible but what bothers me is that if I use this preset, will it make myown code build with v144 as well? This wouldn't be the result I want to get.

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded memsharded self-assigned this May 12, 2025
@memsharded
Copy link
Member

Hi @artem-kamyshev

Thanks for your question.

That is a thing from Microsoft versioning. They overflow the compiler version, but they kept the toolset numbering:

So the compiler can be 1944 or 19.44 from the VS 17.14 update (see https://learn.microsoft.com/en-us/cpp/overview/compiler-versions?view=msvc-170).
Then, the toolset version can also be 14.4 (14.40, 14.41, etc), see https://devblogs.microsoft.com/cppblog/msvc-toolset-minor-version-number-14-40-in-vs-2022-v17-10/

But see in that that link that the platform toolset, is still v143 (starting with the v):

The C++ Project System (MS Build) is being updated to support ‘14.4x’ MSVC toolsets under the v143 Platform Toolset.

So the "toolset version" and the "platform toolset" are different things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants