From: Andrei Melnikov (andy.melnikov_at_[hidden])
Date: 2006-10-16 10:56:22
On 16/10/06, Vladimir Prus <ghost_at_[hidden]> wrote:
> On Monday 16 October 2006 05:53, Andrei Melnikov wrote:
> > On 15/10/06, Vladimir Prus <ghost_at_[hidden]> wrote:
> > 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.
It does have in recent versions (at least 7.1 and 8.0, not sure about
7.0). WPO does work with separate linking in msvc because if WPO is
turned on the compiler produces object files and static libraries in
intermediate byercode, and not in native code. So WPO linking takes
> > 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?
It will require "pch.hpp" to be on header search path, just according
to standards. With /Yu it isn't required - the actual header file can
be anywhere as it isn't used at all. E.g. without precompiled headers
you should use ../pch.hpp, lib/pch.hpp in different locations and with
headers just pch.hpp everywhere.
> > 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
Well, it's actually #pragma hdrstop
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