-
Notifications
You must be signed in to change notification settings - Fork 255
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
[develop2] Missing compiler.runtime setting #531
Comments
Hi @simonimpey - thank you for reporting this issue. The new integration (develop2) currently expects this information to be provided in the I would imagine this could be a problem if you already have a default profile that doesn't define |
Hi, I suspect that cmake is indeed being run from withing a VS shell as it is being run by VS itself, we use VS 2022's native CMake support to simply open the CMakeLists file in Visual Studio. I think though that this is something that should be detected on the fly if possible as it should be possible for different projects on the same system to use different runtime settings. In the short term I shall simply ensure that this is set in the default profile. |
Hi @simonimpey - I see, this is probably relevant if CMake is being run with Visual Studio. I should be able to reproduce this, will give this is a go and see how we can best solve this |
I can confirm that this only happens if you run it via the VSCode integration of CMake. When running the
Running the exact same command (the cmake call that VSCode produces, e.g.
Once that is correctly run from the normal command line, everything works nicely also from within VSCode as we have a correct default profile. However everything also works fine if you run |
Hi @simonimpey - I've tried to reproduce this on my end, but have been unable to. If I open the project directly from Visual Studio (where the VS IDE invokes CMake, and cmake invokes Conan, and there is no default profile) - it seems to work fine.
The Are you still able to reproduce this issue? Could you paste the contents of your default profile, or would you be able to remove/rename the |
HI @fklebert - thank you for reporting this as well. This seems to be an entirely different issue altogether, where no compiler is detected at all. If you could give us some pointers on how to set up VSCode to reproduce this, that would be great! |
I do not do really much else than you obviously tried already.
I get the following output:
It seems to correctly guess the compiler, only the runtime info is missing. The fix on my side is to delete the wrongly generated default profile and run EDIT: Forgot to add that although from the cmake output it looks like it got the compiler right, it does not store it in the default profile on disk. The content of the stored profile after the VSCode CMake call is:
|
HI @fklebert - thank you for providing the log. In this case I have a strong suspicion that the
I'll get working on a fix for these, thanks for your feedback! |
Yes, after the earlier discussion I did exactly that and deleted the 'default' profile and forced conan to regenerate it from a standard Windows Terminal shell. This did indeed set the I think the original cause of the issue was running conan for the first time and auto detecting the profile from within whatever environment VS uses when processing CMakeLists files. Having said this I feel that the choice of runtime should not be system wide as it should be possible for different projects to specify different runtimes. |
In my own tests, Visual Studio was invoking CMake with the "Visual Studio" generator, so the result was the same. Is there a setting to change this to use Ninja instead? If it was using Ninja then it would only fail if the CC/CXX environment variables are used.
Indeed, this is going to be addressed in #516 |
I have encountered the opposite problem, where In the cross-building case, we don't want to leak anything from the default profile into |
I am trying to upgrade a project from Conan 1.x to 2.x. When building using Visual Studio 2022 via it's native CMake support I am running into the following issue:
1> [CMake] ======== Finalizing install (deploy, generators) ========
1> [CMake] ERROR: conanfile.py: Invalid ID: Invalid: 'settings.compiler.runtime' value not defined
1> [CMake] CMake Error at Windows/MSVC/x64/Release/conan_provider.cmake:197 (message):
1> [CMake] Conan install failed='6'
In the Conan 1.x CMake file there were routine(s) for determining the compiler runtime in Visual Studio but these do not appear to be present in the new conan_provider.cmake. What is the recommended method for supplying this setting in via Conan CMake in version 2.x?
The text was updated successfully, but these errors were encountered: