You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
is it possible to determine the source of a specific recipe option or setting.
My library uses Boost. And the user can specifiy through profiles/commandline that Boost is used as header-only or linked as binary (e.g. -o boost:header_only=True).
My library preferres to use Boost as header_only. As the library can be compiled for several targets. Those targets can be quite old where boost:header_only is not possible and Boost has to be linked through binaries.
Normally the boost:header_only option is not set explicitly. In this case I want to be able to set the boost:header_only based on the employed compiler.
Question
How can I detect where the value of a specific option has been set?
default value
profile
command line
...
At the moment it would suffice if I could determine if the value has been set by the user or if it is the default value.
Comparing the current value to the default value is insufficient as the user could specify a value which is the same as the default value.
Best regards
The text was updated successfully, but these errors were encountered:
It's a valid question, and in general it comes up occasionally for many people debugging packages.
I can definitely say that there's currently no way to "query" this information in the way you are asking. I also worth pointing out that the process for evaluating an option's value is pretty involved, because every recipe in the graph has the opportunity to change the value of an option in it's own configure and/or config_options, and the final value can depend on the order the dependencies are evaluated.
So, with that said, I can see two possibilities:
Experiment with logging the value of the options using hooks (either to stdout or to file)
Sadly, I don't see a post_configure or post_config_options, but perhaps post_package_info might do it, not sure.
Maybe this turns into a feature request for a post_configure hook, which could be used for this purpose
Potentially this could become a feature request to simply add additional logging to the current Conan evaluation of settings and option, enabled under the configuration item conan_logging_level=info, or perhaps a new dedicated configuration item conan_log_options.
Either way it's probably a feature request, so ping @memsharded to see if either of those ideas sounds reasonable.
Hi there,
is it possible to determine the source of a specific recipe option or setting.
My library uses Boost. And the user can specifiy through profiles/commandline that Boost is used as header-only or linked as binary (e.g. -o boost:header_only=True).
My library preferres to use Boost as
header_only
. As the library can be compiled for several targets. Those targets can be quite old whereboost:header_only
is not possible and Boost has to be linked through binaries.Normally the
boost:header_only
option is not set explicitly. In this case I want to be able to set theboost:header_only
based on the employed compiler.Question
How can I detect where the value of a specific option has been set?
At the moment it would suffice if I could determine if the value has been set by the user or if it is the default value.
Comparing the current value to the default value is insufficient as the user could specify a value which is the same as the default value.
Best regards
The text was updated successfully, but these errors were encountered: