Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2007-09-09 06:15:58


Dirk Griffioen wrote:

> Hi All,
>
> I have a small question regarding <define>
>
> If I specify a define on the commandline, like
>
> bjam toolset=gcc define=BLA
>
> I get a
>
> 'error: Duplicate name of actual target'
>
> on the lib(s) in the jamfile.

You bug report does not include neither a minimal
project reproducing this behaviour, not the error message,
so strictly speaking I cannot reproduce this. Please include
that information for any subsequent bug reports.

This time, I happen to know what's wrong. Say you have:

        exe a : a.cpp helper ;
        lib helper : helper.cpp ;

And say

        bjam toolset=gcc define=BLA

Boost.Build first builds 'helper' with define=BLA.
Then it builds a with define=BLA. That requires also building
helper. Since 'define' is not a propagated feature, this
requests a build of 'helper' without define. Now, we've built
'helper' twice, and build requests differed only in 'define'. Since
define is not represented in target path, there's no way we can
assign target paths to build versions of 'helper' and we error out.

> Bu when I specify the (exe) target, like
>
> bjam my-exe toolset=gcc define=BLA
>
> there is no problem ...
>
> What happens here? I would like to use defines on the commandline,
> because having them inside the jamfile will create a very complex jamfile.
>
> (I use:
> bjam --version
> Boost.Build V2 (Milestone 11)

Please use the nightly build from boost.org/boost-build2; there, 'define'
specified on command line applies to all attempts to build any targets.

- 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