Inside of a conan profile, we can choose a profile to contain,
compiler.version = msvc
compiler.version = 193
Can someone please explain to me how the versioning works for msvc
. Inside of the settings.yml
I can see the list of possible options,
msvc:
version: [170, 180, 190, 191, 192, 193]
However, these are inconsistent with the versioning by Microsoft. As the documentation says, _MSC_VER distinguishes between major and minor releases. It has the form: MMNN.
. However when choosing,
compiler=Visual Studio
compiler.version=17
This has a consistent mapping with the previous public releases such as viewing the release history. In short, how did conan
come up with these msvc
compiler versions?
Conan is using the first 3 digits of the _MSC_VER
compiler version for these reasons:
cl
MSVC compiler and the binaries built with it is generally very good for the same IDE version, and the IDE versions have so far (until VS 17.10 update) matched the first 3 digits of the compiler version, that is, VS15-2017 had as default compiler _MSC_VER = 191X
, VS16-2019 had _MSC_VER = 192X
and VS17-2022 had _MSC_VER = 193X
_MSC_VER
), those were very extraordinary and very specific to some projects conditioning its code on it.So using the first 3 digits seemed to fullfill the users requests to use the compiler version instead of the IDE version, and provide a good default binary compatibility for the community (like ConanCenter packages). Conan users that want to model binary compatibility after the 4th digit too can do it by defining the compiler.update=[0-9]
setting.