-
Notifications
You must be signed in to change notification settings - Fork 970
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
[Bug] Raising the minimum required CMake version to 3.16 breaks macro conan_set_vs_runtime #6624
Comments
I think this might be an issue for Conan itself, not for cmake-conan only. Please @czoido have a look when possible. |
@memsharded Sorry, I made a mistake, actually trying to post in the Conan repository! |
Hi @Adnn, I'll transfer the issue then |
Hi @Adnn, |
I think it would be quite appropriate for |
The primary effect of cmake_minimum_required is to set policies known as of that version to |
@puetzk Thank you for taking time for the explanation and the link. We were under the wrong impression that CMake behaviour was to keep policies to @czoido @memsharded What would be your opinion about having the CMake build helper automatically set Once again, thank you everyone for taking the time : ) |
Hi @Adnn, |
Fixed in #6626, will be released soon in 1.23 |
@czoido Thank you for the quick fix in the CMake generator! @memsharded We would still argue that some extra step can be taken to actually close this issue: the CMake build helper would be more usable if it also set the |
This is actually opposed to the current design of the helper. Note that it is adding variables like |
It looks like #6626 introduced a bug in
to
Should I open a new issue for that bug? |
Thanks @slietzau I have created a new issue from your comments, to have a look in a new one. Thanks for reporting. |
After some uninteresting bug chase, we found out the following behaviour:
With
cmake_minimum_required(VERSION 3.16)
, CMake will override any runtime related flag (e.g./MT
) that are explicitly set in the CMake scripts. This notably breaks the conan macroconan_set_vs_runtime
, which was doing exactly that.This is likely due to the introduction of MSVC_RUNTIME_LIBRARY, which is a new way to control Windows runtime. Please see related issue conan-io/cmake-conan#174 , with a suggestion for CMake build helper to set this.
As a side note, we would be tempted to consider that a bug in CMake, since the doc states:
Yet, the situation is that simply raising a minimal version does break the behaviour as implemented by Conan.
The text was updated successfully, but these errors were encountered: