Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-06-02 03:20:54


On Wednesday 01 June 2005 13:46, Toon Knapen wrote:
> Phillip Seaver wrote:
> >>I get an error saying that there is a
> >>'duplicate name of actual target: <pbin/gcc/debug>tt_d'
> >
> > I haven't tried what you're doing, but could it be because there's
> > nothing in there that refers to the variant?
> > "<variant>debug:<tag>@debug-name" might work, for example.
>
> Well conditionals do not work in combination with the rule-based <tag>.
> Writing <variabt>debug:<tag>@debug-name results in some error in
> modules.jam ;-(

I think this use case was never considered. You can do all the checking
in the tag rule anyway.

> Your rule below therefor helps a lot because this way one detects inside
> the rule if we're in debug or release. Great!
>
> However, is'nt it missing soth. see below in the script

> else { return $(name) ; }

As Pedro already said, empty return will use the default name. As to why you
were having 'duplicate name of actual target' with:

rule debug-name ( name : type ? : property-set )
{ return $(name)_d ; }

exe tt : tt.cpp : <tag>@debug-name ;

The tag rule returns the exact name of the target, including suffix. So
the above assigned the same "tt_d" name to both exe and the object file.
The error says exactly that:

error: previous virtual target { gcc%gcc.link-tt_d.EXE
{ gcc%gcc.compile.c++-tt_d.OBJ { tt.cpp.CPP } } }
error: another virtual target { gcc%gcc.compile.c++-tt_d.OBJ { tt.cpp.CPP } }

You'd need a call to virtual-target.add-suffix if you want to add the stock
suffix. You probably also need to modify the name only for EXE targets.

HTH,
Volodya

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build V2: http://boost.org/boost-build2
 

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