John Maddock via Boost
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/r... Conditional dependency on ICU packages: https://github.com/build2-packaging/boost/blob/master/libboost-regex/manifes... Conditional importation and linking of ICU libraries: https://github.com/build2-packaging/boost/blob/master/libboost-regex/include...