Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-10-16 02:38:14

On Monday 16 October 2006 05:53, Andrei Melnikov wrote:
> On 15/10/06, Vladimir Prus <ghost_at_[hidden]> wrote:
> > I was thinking more about PCH support. While it can decrease compilation
> > time for toolsets with PCH support, having a central header including all
> > STL and all Boost, and all Windows headers will reduce compilation time
> > when PCH is not available. How about making pch generators set a macro,
> > has
> > BOOST_BUILD_PCH_ENABLED, so that client code can use this:
> >
> > #if defined(BOOST_BUILD_PCH_ENABLED)
> > #include "pch.h"
> > #endif
> >
> > Then, if toolset lacks PCH support, the pch header won't be included at
> > all.
> >
> > Thoughts?
> I like this feature. Personally, I already have this macro. I called
> it STDAFX_DISABLED, so your name is rather good.
> Also, last time I checked (VS2005 beta 2) some optimizations (namely
> WPO) didn't work if PCH were used. So it's useful to maintain both
> pch- and non-pch configurations.
> However, just to note, Boost.Build still doesn't enable whole program
> optimization in release builds.

I don't use msvc, so it's no suprised. In fact, I never though it has whole
program optimization. Does it work even if you compile each file separately?
Will linker to WPO? Or you need to pass all .cpp files at once to the
compiler -- like is the case with gcc.

> Also MSVC has strange behaviour regarding the #include "pch.h"
> statement. "pch.h" is just a label passed to it's /Yu switch, it's not
> a usual include name reference.

But if /Yu is absent, will #include "pch.hpp" work?

> I mean that #include "pch.h" isn't portable - it stops to work in some
> cases at all in case of MSVC if PCH are turned off, so the whole issue
> around BOOST_PCH_ENABLED isn't just about speed boost. It would also
> help to create code portable between pch-on and pch-off and between
> different compilers.
> Also I wonder now other compilers support PCH - e.g. if there some
> compilers using #pragma stop.

I wish I know what's this question is about :-( How #pragma stop is related to

- Volodya

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