Open prince-chrismc opened 1 year ago
Good news, when the patch is applied https://github.com/conan-io/conan-center-index/blob/404cd727b1387a69dca62a5588596effd1a69f48/recipes/yasm/all/patches/0001-platformtoolset.patch the toolset can be correctly applied
mmm is the case here that if the patch defines the <PlatformToolset>
(regardless of the value), then the override by the generator will work with the value coming from it? Or is it the case that the patch works because it hardcodes the value in the patched file?
The case is without <PlatformToolset>
build fails (new helper does nothing).
The patch can be override with the build helper
I think the key is:
if compiler == "msvc":
subs_toolset = settings.get_safe("compiler.toolset")
if subs_toolset:
return subs_toolset
return msvc_version_to_toolset_version(compiler_version)
The MSBuildToolchain
only implemented support for msvc
compiler, not Visual Studio
one. The idea was that ConanCenter was going to move to that compiler in 1.X, to be fully ready, profiles, etc, but I am not longer sure this is happening/possible, to be discussed.
If not happening, I guess the Visual Studio
compiler management should be added there.
Reviewing and playing with https://github.com/conan-io/conan-center-index/pull/13185 I discovered the new toolchain and build helper are able to pass in the compiler toolset from the settings model (or the recipe)... but not how I was expecting.
❓ Is this a limitation given the tribe decided on higher support (where this value should always be present) or is it possibly a bug? ❓ Is this expected when migrating old projects to Conan 2.0?
The recipe is currently building with https://github.com/yasm/yasm/tree/v1.3.0/Mkfiles/vc10 which does not have the
PlatformToolset
defined in any of the configurations.Calling
conan create all 1.3.0@ -pr msvc2019
results inModifying the recipe with
Leads to the same problem as well as
conan create all 1.3.0@ -pr msvc2019 -s compiler.toolset=v142
https://github.com/conan-io/conan/blob/8aeea2230fd6375ce1da15f2380097bed9098377/conan/tools/microsof
Good news, when the patch is applied https://github.com/conan-io/conan-center-index/blob/404cd727b1387a69dca62a5588596effd1a69f48/recipes/yasm/all/patches/0001-platformtoolset.patch the toolset can be correctly applied
in a 2019 prompt it will fail with any toolset other then v142 (which is expected) and in a 2022 prompt it will only work in with
toolset=v143
... both work with the default provided toolset giventoolset=None