-
Notifications
You must be signed in to change notification settings - Fork 365
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
[question] How to correctly setup comaptibility() for msvc compiler #3840
Comments
Hi @ibrawada Thanks for your question. The That means, that in your case you have def compatibility(self):
if self.settings.compiler == "msvc":
return [{"settings": [("compiler.version", v)]}
for v in ("190", "191", "192", "193")] Please try that and let us know. |
Hello @memsharded I have also around with the method and had following findings.
Different from what is expected according to this documentation. Something like the following:
Both of the formats work. What doesn't work for some reason is compatibility for build_type
outputs:
Conan doesn't identify the package as compatible at all If i rewrite the compatibility method to
outputs:
Conan identifies the package as compatible but still cannot use the built Debug package for the Release consumer. If i try the compatibility() with "Visual Studio" compiler, then Conan doesn't identify the package as compatible at all
outputs:
Sorry for the long analysis, but im getting quite confused here. |
The documentation is kind of correct, but a bit poorly explained. They aim to be different settings, not the same setting with different values. I agree that adding some more explicit example might help. That means the correct way is the second one: def compatibility(self):
return [{"settings": [("build_type", v)]} for v in ("Release", "Debug")] Put it other way: The
Yes, this is generally expected in Windows, there is no binary compatibility between Debug and Release artifacts, so the above is not true and cannot be used, it will be incorrect telling they are compatible if they are not. Please let me know if this clarifies the issue. |
Thanks for even more explanation it makes now perfect sense. Your explanation should definitely go into the offcial documentation. Thanks again, I will close this issue tomorrow |
It might depend also on the artifacts types (shared libs, static libs), the language (C or C++), and the VS runtime linkage. In many situations the VS compiler will directly refuse to link. If you have a setup that you can do it, it sounds more like the exception than the general case. So it is not only that is "bad practice", is that it will directly not work in many cases.
Do not close the ticket please, I will transfer it to the "docs" repo to try to do some improvements there in the docs. Thanks very much for the feedback! |
What is your question?
Hello,
I am using Conan v1.62.0 on Windows 10
I have an upstream mylibrary that i compile for following configuration:
shared=true with msvc v193 compiler (in VS2022).
I have a downstream application that links against mylibrary. The application must be built with msvc v190 (also in VS2022). I have tried to link everything manually and it compiled and worked.
Inside the upstream mylibrary i have following compatibility function:
running conan install give me following error:
It seems that Conan recognizes that msvc v193 package is compatible but for some reason still doesn't want to use it.
Any idea how to rewrite compatibility() in order to tell Conan that package built in v193 is compatible for app built with v190?
Thanks
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: