[LV2] Bikeshed: include paths

David Robillard d at drobilla.net
Mon Oct 5 06:48:14 PDT 2015


LV2 currently uses header include paths based directly on the URI of the
relevant extension.  This is nice because the same convention can apply
to all LV2 specs (including non-official ones) without any possibility
of clashing.  However:

1) The official LV2 namespace is unfortunately deep and sloppy.

2) Working in a source tree structured this way is unpleasant.

Accordingly, I am thinking of changing the structure used for the
official headers to e.g.

#include <lv2/atom/atom.h>

where "lv2/" is reserved for LV2 itself (as usual with C libraries).

This might be a good time to change so that headers are installed with a
versioned directory to allow for parallel installs,
like /usr/include/lv2-1.0/lv2/... This is the usual best practice for C
libraries, but since LV2 isn't a library I am not sure there is a point.
LV2 isn't allowed to break, so if it did, it would be lv3 anyway?  That
said, *having* to provide an explicit include path avoids some "what am
I building against?" confusion.

Downside: if the source tree is restructured this way, code using the
current/old #include scheme can no longer be built against the LV2
source distribution (without building it first).

Thoughts?

-- 
dr



More information about the Devel mailing list