Boost logo

Boost-Build :

From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2006-01-20 02:51:04

Matthew Herrmann wrote:
> Hi All,
> I'm setting up a library structure where each library lives in its
> own folder, with an accompanying unit test in the "test" subfolder.
> When the library builds, I also build a unit test using the boost
> framework.
> The problem I have is that when the user imports the project, say,
> "hello", they will pull in all the link dependencies of the unit test
> as well. This is problematic using Boost's unit test framework since
> it links in libraries that _must_ only be used by unit test programs.
> Some solutions I've thought of but dislike are :
> * separate project for unit test : defeats cohesion

Why does it defeat cohesion? I usually lay out my libraries something along
the lines of this:

                # common Jamfile for foo would go here
                    # Jamfile for foolib would go here
                        foo # if separate namespace
                    # Jamfile for footest would go here

> * change all clients to link to project using "hello//hello" syntax :
> ugly and flimsy

 You could always hide it, and use a variable to access the actual value -
e.g. $(HELLO_LIB).

> * add aliases for every library used : maintenance and centralization
> issue

Doesn't using aliases simplify maintenance? If the location and/or
definition of the lib change, you'll only have to change the alias
definition in a single place. I'm not sure what you mean by centralization

[snip rest]

// Johan

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at