
14 Mar
2023
14 Mar
'23
9:12 a.m.
There does need to be a way to recognise optional or soft dependencies though -- a library might include a compatibility header that can optionally be included if you are also using another library, but this should not require the other library as a hard dependency.
If you in turn write a library or app that does use both, then you depend on both, but they don't depend on each other.
I think it's ok to put this on the downstream author -- they will try to build, get a compile error, then add the missing dependency themselves.
Agreed 100%. The canonical example is serialization: you will most certainly know that you need that library if you intend to serialize and install it anyway, so no need for an automatic dependency. John.