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
I want to have BOOST_ASIO_HAS_STD_INVOKE_RESULT and BOOST_BEAST_USE_STD_STRING_VIEW defined for asio/beast in my project, but this isn't suitable for everyone. Right now I just have a fork of this repo that defines these for those rules, but I would prefer if there was a way for me to define these for my project without maintaining a fork.
I was thinking about something like a new macro named boost_default_defines() that would mutate the default_defines in boost.bzl. However I think that in order for this to work it would require evaluating all the boost_library rules currently defined in BUILD.boost via a new macro call, since these rules are currently expanded eagerly before it's possible to change the default_defines. Or perhaps the new macro call would take a list of default defines, which is equivalent.
Mechanically this change is not too difficult but the diff would change most lines in BUILD.boost and also change how this repo is used, i.e. users would have to make a new macro call in order to define all the boost library rules. I'm far from a Bazel expert so perhaps there's a more clever way of accomplishing this goal without making such an invasive change.
The text was updated successfully, but these errors were encountered:
A common practice is to check in a patch in your project. This should eliminate any need for a fork, but I do still think it's a little suboptimal. Mutating state in other bzl files is not possible, so any configurability would need to be done with something like this.
Here's an example of how you might implement the patch solution.
I want to have
BOOST_ASIO_HAS_STD_INVOKE_RESULT
andBOOST_BEAST_USE_STD_STRING_VIEW
defined for asio/beast in my project, but this isn't suitable for everyone. Right now I just have a fork of this repo that defines these for those rules, but I would prefer if there was a way for me to define these for my project without maintaining a fork.I was thinking about something like a new macro named
boost_default_defines()
that would mutate thedefault_defines
inboost.bzl
. However I think that in order for this to work it would require evaluating all theboost_library
rules currently defined inBUILD.boost
via a new macro call, since these rules are currently expanded eagerly before it's possible to change thedefault_defines
. Or perhaps the new macro call would take a list of default defines, which is equivalent.Mechanically this change is not too difficult but the diff would change most lines in
BUILD.boost
and also change how this repo is used, i.e. users would have to make a new macro call in order to define all the boost library rules. I'm far from a Bazel expert so perhaps there's a more clever way of accomplishing this goal without making such an invasive change.The text was updated successfully, but these errors were encountered: