-
Notifications
You must be signed in to change notification settings - Fork 980
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
Improved conan configuration (settings/options) approach [2.0] #3524
Comments
I think it would be good to have some method to check the current version of Conan being used so that during the transition it would be possible to write recipes that are both compatible with 1.x and 2.0. Also, it would be nice to specify in the recipe the minimum required version of Conan, something like |
I am not sure if this is the main thread tracking all wishes for Conan v2.0, but if it is, I would also like to add Issue #3573. |
I think I might need conditional setting of default options for my requirements: conan-community/community#168 |
@Lawrencemm, you can do that even in conan v1.x (see #3519): consider this package: class SomethingConan(ConanFile):
...
options = { use_some_feature: [True, False] }
def config_options(self):
if self.options.use_some_feature == None: # i.e. not specified on the command line
if self.settings.os == 'Android':
self.options.use_some_feature = True
else:
self.options.use_some_feature = False It works with all kind of options (string options, enum options, boolean options). I use that pattern in my projects all over the place. Just note that you must compare with |
Also adding #4038 to the wishlist for Conan v2.0 (although I argue it should be possible to implement that feature even in v1.x, without breaking, as I described in the issue description). |
@memsharded I would like you to put in common these topics. This sounds like something we could start doing before 2.0 (if we consider it). |
I think this concerns have been addressed in 2.0 betas:
Doable, and the pattern matching has been improved, with better priority based on cli (or profile) order argument
It is already possible with
Already changed the priority, so defining values conditionally on recipe configure methods works fine without invalidating profile priority
The above linked PR shows this is already possible and works fine. Lets close this issue, if there is something pending or not clear, please report. |
There are several things that might require reviewing in conan 2.0:
-s *:build_type=Release -s build_type=Debug
.self.settings["MyDep"].build_type
config=
for empty stringThe text was updated successfully, but these errors were encountered: