|
Boost-Build : |
From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-12-11 14:12:45
Bojan Resnik wrote:
> Consider the following Jamfile:
>
> -------
> import cast ;
>
> exe e : ep e.cpp : <cxxflags>/vmg ;
> pch ep : [ cast _ pcheader : ep.hpp ] ep.cpp ;
> -------
>
> The precompiled header is compiled without the /vmg compiler switch,
> while the source file is correctly compiled with it.
>
> It seems that the PCH doesn't inherit any requirements of the project
> that uses it, which often makes it invalid.
Is this the correct behaviour?
Consider:
pch stdafx : [ cast _ pcheader : stdafx.h ] stdafx.cpp ;
exe app1 : ... stdafx : <define>HELLO ;
exe app2 : ... stdafx : <define>WORLD ;
In the above, stdafx would inherit both defines. Would this be the
required behaviour.
I have not had chance to look into this in depth yet, but the workaround
to your issue would be to add the arguments to the pch target as well:
exe e : ep e.cpp : <cxxflags>/vmg ;
pch ep : [ cast _ pcheader : ep.hpp ] ep.cpp : <cxxflags>/vmg ;
- Reece
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