Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-06-17 09:20:45


Ali Azarbayejani wrote:
> Vladimir Prus wrote:
> > David Abrahams wrote:
> >>>>In fact, I don't know the meaning of dependency on main target.
> >>
> >>It means that you depend indirectly on everything that main target
> >>depends on, i.e. all of the subvariants which get built. Generally
> >>that won't occur, but the main target can be requested from the
> >>command-line, in which case you can view the whole build as depending
> >>on it.
> >
> > Can you clarify: will build system ever create depency on main target
> > during invocation of 'realize' rule. IOW, will 'realize' only exend
> > dependency graph with instances of "file-target" from Ali's proposal.
>
> The 'realize' rule never creates dependencies on MainTargets. Realize
> only creates FileTarget nodes in the graph.

Oh... and that what made me wonder once again if we need a common Target
class.

> I realize now that "MainTarget" is not really a "target" itself; it is a
> specification of a type of target, including information on how to
> construct variations of that type of target. I'm not sure any more if
> it even belongs in the Target heirarchy or as a node in the dependency
> graph.

So, we're almost back to separate hierarchies for abstract-target and
virtual-target. However....

1. The word "specification" starts to resonate for me, and it's sounds better
than 'abstract-target'. So, the 'abstract-target' can become 'target-spec',
and the 'generate' rule will remain basically as is.

2. As I've said before, I wanted to exploit the similiarity between main
target reference and file --- when used in a source. Now I see how this can
be done. Besides ProjectSpec and MainTargetSpec, we can have FileSpec class,
which 'generate' method only returns target to the named file. We'll have

for s in sources:
source_targets = []
TargetSpec t = targets.find(p.value())
source_targets += t.generate(build_properties)

and there's not need to distinguish between main target and file.

(Take a look at line 595 in targets.jam: the call to 'find' now can return
two unrelated classes, and that's *ugly*).

3. There's still the question where main-target-type-specific code should
reside. But that's topic for another discussion.

- Volodya

 


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