conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.31k stars 986 forks source link

[question] should we be using `msvc_version_to_vs_ide_version` in recipes #12322

Open prince-chrismc opened 2 years ago

prince-chrismc commented 2 years ago

Not converted to new tools, can't be used as it's part of a private import.

_Originally posted by @uilianries in https://github.com/conan-io/conan-center-index/pull/13365#discussion_r996955447_

This has some useful benefits during the 2.0 migration period

prince-chrismc commented 2 years ago

Space pointed out this a a really inline with https://github.com/conan-io/conan/issues/11158#issuecomment-1252341119

but did not come up in my search so leaving traces here hopefully the next person will find it

uilianries commented 2 years ago

@prince-chrismc Thank you for pointing it!

theirix commented 2 years ago

A helper like this could be very helpful for CCI recipes because currently we need to write two conditions for "msvc" and "Visual Studio" compilers based on non-trivial version mapping which Conan already knows.

Issue #11158 was resolved with introducing a new helper check_min_vs which throws an exception so it does not help with writing conditionals in recipes. And unfortunately msvc_version_to_vs_ide_version is not a public API. Either we need to expose msvc_version_to_vs_ide_version or to create another helper like is_min_vs.

prince-chrismc commented 2 years ago

https://github.com/conan-io/conan-center-index/pull/13799

paulharris commented 1 year ago

check_min_vs does not help in the situation where the library wants to know the VS version for a configure target... in this case libvpx wants to know what VS version for its arch--os--compiler triple. https://github.com/conan-io/conan-center-index/pull/13799

So still need a msvc_version_to_vs_ide_version, that would help.