Boost logo

Boost-Build :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-11-24 04:12:01


Vladimir Prus wrote:
> On Wednesday 23 November 2005 19:02, Reece Dunn wrote:
>>> I think it's possible to make pch-related feature "propagated to direct
>>> dependents only".
>> That would solve this problem. Do you know how to do this?
>
> Sure :-) Go to build/targets.jam, class basic-target, method
> compute-usage-requirements. Find line:
>
> result = [ $(result).add
> [ $(subvariant).sources-usage-requirements ] ] ;
>
> Remove properties you don't like for sources usage requirements before adding
> them.
>
> Sorry for not being very helpful with coding this, but I promise to commit the
> patch even if <pch*> features are hardcoded here ;-) I'll add new feature
> attribute if and when we'll have another case where propagation to direct
> dependents only is desired.

Hmmm. This didn't work :( That only had <xdll-path> properties.

> To clarify -- yes, I think it's fine to hardcode features here, provided you
> add a comment explaining why they are special. I don't want to introduce
> generic mechanism for the sake of one use-case.

NOTE: I get the same error if I comment out the <pch-header>/<pch-file>
properties, so this was a red herring. Looking at the --debug-generators
output (see attachment for the relevant sections) the problem is when
evaluating the LIB target.

Things I have noticed:

1. The PCH generator is spawned 3 times (see generators.txt) when it is
only used twice (or are there two for library A that inherits from
library B, inheriting B's PCH);

2. The first library (lib B) is being processed without a problem;

3. lib A is inheriting lib B's PCH twice (the ones matked with a '*');

4. If I rename lib B's PCH to stdafx2, BBv2 will accept it, but msvc
will fail because of the multiple PCH files (from the duplicate <pch-*>
properties.)

So, as well as finding the right place to prune duplicate <pch-*>
properties, I need to find out how to prune inherited PCH generator
actions (isn't this what compile generators do?).

Any help is greatly appreciated.

- Reece


     trying generator msvc.compile.pch ( PCHEADER -> OBJ PCH )
       generator msvc.compile.pch spawned
       generator msvc.compile.pch spawned
       generator msvc.compile.pch spawned
       generator builtin.lib-generator spawned

       { msvc%msvc.link.dll-core.dll.SHARED_LIB
         { msvc%msvc.compile.c++-main.obj.OBJ { main.cpp.CPP } }
         { msvc%msvc.compile.pch-stdafx.obj.OBJ { stdafx.h.PCHEADER } }
       }
       { msvc%msvc.link.dll-core.lib.IMPORT_LIB
         { msvc%msvc.compile.c++-main.obj.OBJ { main.cpp.CPP } }
         { msvc%msvc.compile.pch-stdafx.obj.OBJ { stdafx.h.PCHEADER } }
       }

     trying generator builtin.lib-generator ( -> LIB )
         trying generator msvc.link.dll ( OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB -> SHARED_LIB IMPORT_LIB )
             trying generator msvc.compile.c++ ( CPP -> OBJ )
             trying generator searched-lib-generator ( -> SEARCHED_LIB )
             trying generator msvc.archive ( OBJ -> STATIC_LIB )
               generator msvc.archive spawned
               generator searched-lib-generator spawned
             generator 'msvc.archive' pruned
          failed to convert { msvc%msvc.compile.pch-stdafx.pch.PCH { stdafx.h.PCHEADER } }
               generator msvc.compile.pch spawned
               generator searched-lib-generator spawned
               generator msvc.archive spawned
               generator searched-lib-generator spawned
             generator 'msvc.archive' pruned
          failed to convert { msvc%msvc.compile.pch-stdafx.pch.PCH { stdafx.h.PCHEADER } }
               generator searched-lib-generator spawned
          failed to convert { msvc%msvc.link.dll-core.dll.SHARED_LIB { msvc%msvc.compile.c++-main.obj.OBJ { main.cpp.CPP } } { msvc%msvc.compile.pch-stdafx.obj.OBJ { stdafx.h.PCHEADER } } }
           generator msvc.link.dll spawned
       generator builtin.lib-generator spawned

       { msvc%msvc.link.dll-client.dll.SHARED_LIB
         { msvc%msvc.compile.c++-main.obj.OBJ { main.cpp.CPP } }
         { msvc%msvc.compile.pch-stdafx.obj.OBJ { stdafx.h.PCHEADER } }
        *{ msvc%msvc.compile.pch-stdafx.obj.OBJ { stdafx.h.PCHEADER } }
        *{ msvc%msvc.compile.pch-stdafx.obj.OBJ { stdafx.h.PCHEADER } }
         { msvc%msvc.link.dll-core.lib.IMPORT_LIB
          *{ msvc%msvc.compile.c++-main.obj.OBJ { main.cpp.CPP } }
          *{ msvc%msvc.compile.pch-stdafx.obj.OBJ { stdafx.h.PCHEADER } }
         }
       }
       { msvc%msvc.link.dll-client.lib.IMPORT_LIB ... }

error: Duplicate name of actual target: <p..\..\..\..\build\test\pch\dependant\client\msvc-7.1\release>stdafx.obj


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