On 5/28/21 12:42 PM, Niall Douglas via Boost wrote:
On 28/05/2021 01:12, Peter Dimov via Boost wrote:
How are you handling the repositories which are generated from external repos? I'm thinking of Outcome and ASIO.
I'm not handling them in any way at the moment. But Outcome already has a CMakeLists.txt file, which is largely correct (it's missing a dependency on Boost::throw_exception and there are a few more cosmetic issues that don't really matter.)
I'm pretty sure Outcome *does* have a dependency on Boost::throw_exception:
1. Boost::outcome target link libraries Boost::exception with INTERFACE.
2. Boost::exception target link libraries Boost::throw_exception with INTERFACE.
3. INTERFACE link libraries is transitive, so by describing a dependency on Boost::exception, we are declaring a dependency on all the dependencies of Boost::exception which includes Boost::throw_exception.
Now, you may wish every library to *directly* indicate its dependencies for some definition of "directly". If that is the case however, then Outcome would need to list every second and third order dependency of its first order dependencies. That seems brittle to me.
I think, what Peter sees is that you are including boost/throw_exception.hpp directly, in boost/outcome/config.hpp, which means you have a direct dependency on it. Second order dependencies need not be specified in CMakeLists.txt, CMake will figure those out as it resolves dependencies.