Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-04-26 07:09:50


On Wednesday 26 April 2006 13:52, Bojan Resnik wrote:

> The biggest issue that I have with PCHs is that the requirements of
> the main target are not propagated to the PCH. For example:
>
> import cast ;
> pch mypch : [ cast _ pcheader : pch.hpp ] pch.cpp ;
> exe hello : mypch main.cpp
>
> : <define>ABC
>
> ;
>
> main.cpp will be compiled with ABC defined, while pch.cpp will not.
> This gets more problematic if the exe uses other libraries which have
> usage requirements, since these are not propagated either.

Hi Bojan,
I think it's possible to allow including PCH file right into exe:

  exe hello : [ cast _ pchheader : pch.hpp ] main.cpp : <define>ABC ;

and in that case PCH will be created with right properties. But this raises
question about reusing of the same PCH by different targets:

  pch mypch : [ cast _ pcheader : pch.hpp ] pch.cpp ;
  exe a : a.cpp mypch : <define>ABC ;
  exe b : b.cpp mypch : <define>ABC ;

In which case we'd need either to propagate defines, or manually add define to
PCH. And what should happen in this case:

  pch mypch : [ cast _ pcheader : pch.hpp ] pch.cpp ;
  exe a : a.cpp mypch ;
  exe b : b.cpp mypch : <define>ABC ;

Should it be an error?

- Volodya

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build V2: http://boost.org/boost-build2

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