Boost logo

Boost-Build :

From: Bojan Resnik (resnikb_at_[hidden])
Date: 2006-11-06 11:44:06


> > Another issue when using the same pch for multiple targets, are the
> > usage requirements of dependencies:
> >
> > lib some-lib : : : <runtime-link>static ;
> > lib some-other-lib : : : <runtime-link>shared ;
> > exe hello : hello.cpp pch some-lib : <define>FOO ;
> > exe hello2 : hello.cpp pch some-other-lib : <define>BAR ;
> >
> > The usage requirements of some-lib should be propagated to the pch
> > if compiling hello, and those of some-other-lib if compiling hello2.
>
> Hmm, this seems to indicate that one cannot use a single PCH for all targets
> in entire project. That's bad, but I'm not sure what could be done about it.

  IMHO, *-pch and obj rules should behave the same. In general, if all
*-pch rules were replaced by obj rules the project should still
compile in the same way. For this reason, I think that property
propagation should occur for pch rules in the same way they do for obj
rules.

> > I think it would be best to use one pch target for one project:
> >
> > cpp-pch pch : pch.hpp ;
> > exe hello : hello.cpp pch : <define>FOO ;
> >
> > cpp-pch pch2 : pch.hpp ;
> > exe hello2 : hello.cpp pch2 : <define>BAR ;
>
> Isn't this a little bit too much work? Again, I'm not sure how improve on
> this.

   obj rule behaves the same. If one wanted to use the same obj file
in these two targets, then a similar duplication would have to exist.

-- 
Bojan Resnik

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk