|
Boost : |
From: Boris Kolpackov (boris_at_[hidden])
Date: 2024-04-09 18:27:40
John Maddock via Boost <boost_at_[hidden]> writes:
> Right, the currently experimental Boost.Regex module support has a hard
> dependency on ICU if the latter is installed on your system, irrespective of
> whether you're actually using that feature or not. Stone age indeed. I
> probably need to split it into 2 modules just because of that. But that
> leaves you scrabbling around trying to figure out which sources you need to
> link against and which not... and that's just for one Boost library!
> There's still a lot left to figure out here...
The "state of the art" solution for this (e.g., in Rust, build2) is to
use the package manager to specify not only the version constraint of
your dependencies but also the desired features (in build2 we call it
"dependency configuration"). So in your case, projects that wish to use
Boost.Regex with ICU support would request that feature and based on that
the Boost.Regex's build system will decide whether to link ICU, etc.
This is what it looks like in build2:
The feature (called "configuration variable" in build2):
https://github.com/build2-packaging/boost/blob/master/libboost-regex/build/root.build#L31
Conditional dependency on ICU packages:
https://github.com/build2-packaging/boost/blob/master/libboost-regex/manifest#L24-L25
Conditional importation and linking of ICU libraries:
https://github.com/build2-packaging/boost/blob/master/libboost-regex/include/boost/buildfile#L16-L20
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk