Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2005-08-07 08:21:02

"John Maddock" <john_at_[hidden]> writes:

> * It searches for library names first, so using "regex" as a name will give
> you everything in the libs/regex directory and everything that depends on,
> but that's not the case here.
> * If you include the header of a library with separate source, then you get
> that libraries source and all it's dependencies, but that's not the case
> here.
> * When you include a header, bcp doesn't know what compiler you're using, so
> it follows all possible preprocessor paths. If you're distributing a subset
> of Boost with you're application then that is what you want to have happen
> in general. This is the case here, and it does bloat things, but not by as
> much as you think:
> Running:
> g++ -x c++ -E -I. boost/shared_ptr.hpp | grep -c 'boost/'
> Gives an answer of 83, so that's the smallest number of headers you could
> have got away with for that one compiler, then running bcp in report mode,
> we can see what all the "extra" headers are:
> * All of the config system *headers* (52 headers, would be about 6 for one
> compiler only).
> * All of the shared pointer synchronisation code (24 headers, would be about
> 4 for one compiler/platform).
> * A lot of MPL and type traits code that includes workarounds for broken
> compilers that you may or may not need (in fact gcc appears not include any
> of these headers at all).
> * A lot of preprocessor lib headers, that are only really needed for type
> traits and MPL maintenance, some of these could be trimmed out, but it's not
> clear how many: MPL in particular cannot be used at all without the
> preprocessor lib.
> To conclude: the only "minimal" version would be to extract the headers used
> by a *specific compiler*, but you can already do that by preprocessing the
> header and grepping for the filenames to copy.


This description and the example would make a great addition to the
bcp documentation.

Dave Abrahams
Boost Consulting

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at