-
Notifications
You must be signed in to change notification settings - Fork 986
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] 'Visual Studio' settings are incorrect. #7019
Comments
Hi! Yes, this is something that we should probably revisit for Conan v2.0, without breaking current implementation it is not possible to change these default settings. I'm going to add it to the corresponding milestone. Thanks for the suggestion |
We are trying to move forward the new Please read the comment from @DoDoENT in #3573 (comment). It is not possible to define only "static" "dynamic" runtimes, they are using combinations, building in release, but linking with MDd runtime. |
@DmitrySokolov , nothing prevents you to compile your code in release mode and link it with MDd or MTd. You just need to make sure to define Of course, you must not mix the object files/static libraries built against MD and MDd (or MT and MTd) in the same final binary (DLL or exe), as those two are not compatible. |
@DoDoENT
Why are you calling it release? It will be the debug configuration with some optimizations switched on. |
@DoDoENT |
Actually, I am calling this "Dev-Release", as it's not "release" (because of
I guess you're right 😄 . However, keep in mind that this configuration is different from what VS treats as "Debug". Also, we use the same name on other platforms (Linux, Mac, Android, iOS), where there are no concepts of "debug" and "release". |
OK, let's see: you are building a DLL in "dev-release" configuration, can it be used in an app, that uses MD runtime? |
No, you can't - you need to use it in an app that uses MDd runtime (you cannot link together binaries built against MD and MDd runtimes). It's similar to how you can't link together binaries on Linux built against libc++ and libstdc++ runtimes. |
No. OK. So, why it is different from what VS treats as "Debug". Just because you've switched on some optimizations? |
Yes - if you step through the code with the debugger, due to reordering of the code caused by the optimizations, the steps won't follow the code as written. Also, some variables may not be visible and some functions could not be stepped-into due to inlining. It's hardly a "Debug" version 😛 |
I think it will be completely confusing for everyone to use "release" libraries that require "MDd" debug runtime. |
I see no problem to build optimized debug libraries, and add some conan option to packages, that will distinguish them from ordinary debug packages. @memsharded |
Don't get me wrong. I am not against your proposal - I've even written that in my original comment in other thread:
I just don't want to be prevented from doing my "optimized debug builds", as you call it. I'm perfectly fine with having
In general, I like the simplicity of I'm OK with having some custom sub-settings, like current |
Ok, I think this discussion makes sense. I will try to go with
Actually this is the opposite. We are right now improving support for custom configurations in CMake and MSBuild |
For what purpose? You build a package, assign a meta (conaninfo.txt) for it, like
When you install a package, you provide settings, like If your package requires some flags, you provide them in
For VS it's just the flag
What do mean? If someone adds "build_type=MyConf" in settings.yml how should conan treats it? It's easy -
I do not actually understand, what kind of a support is required. As for me, I use conan for building (and consuming) packages using QMake, CMake, VS. And I use build configuration names like "Release Pro with someth. turned on" without any troubles. |
You need to provide one of these flags to |
It should be handled by the conan recipe: class MyPackage(ConanFile):
package_info(self):
if self.settings.build_type == "MyConf" and self.settings.compiler == "Visual Studio":
self.cpp_info.cxxflags = ["/MDd"] |
But this can be done even now, and does not require neither However, conan currently automatically appends My question is what should conan automatically append to |
the new settings model for
Conan 2.0-beta is out there, feedback welcome |
To date there are following settings for 'Visual Studio' compiler:
The item
runtime:
should have the following values:[dynamic, static]
The reasons:
You can not use flags
MDd, MTd
in release builds (and vice versa):The text was updated successfully, but these errors were encountered: