[build2] Header-only library
Boris Kolpackov
boris at codesynthesis.com
Tue Apr 10 14:48:38 UTC 2018
Per Edin <per.edin at peredin.com> writes:
> I'm working on a new C++ header-only library. Does build2/bpkg support such
> projects? I couldn't find any examples in the documentation.
>
> I know using a header-only library pretty much involves adding an include
> dir, but I'd like to be able to do this for header-only libraries too:
>
> b config.import.libhello=../libhello-1.1.0
>
> That would automatically include dependencies of libhello, possibly
> shared/static libraries but also other header-only libraries.
Proper support for header-only libraries is on our TODO list and
exactly as you've described: with import, automatic linking of
prerequisite libraries (not necessarily header-only), etc.
In the meantime, the workaround is to add a dummy source file.
And once we implement this, all you will need to do to convert
is to drop this source file.
Boris
More information about the users
mailing list