Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-03-28 02:26:09


Hi Andre,
> Problem:
> link against libraries with different names under different toolsets
>
> My solution:
> project a ;
> lib b : : <name>libb <toolset>gcc ;
> lib b : : <name>b <toolset>msvc ;
> lib a : main.cpp b : <link>static ;
> # somehow the problem goest away with <link>shared
>
> The error:
> error: Duplicate name of actual target: <.>b
> previous virtual target { b.SEARCHED_LIB }
> another virtual target { b.SEARCHED_LIB }

Nice! Our safeguards get into the way. If we did not check for duplicate
names, we'd work just fine.

> I hacked virtual-target.jam to allow two searched-libs with the same name
> but I'm afraid that is not the rigth solution. Anyone cares to shed some
> light on this?

The problem is that 'searched-lib-target' is not associated with build
properties. There's lengthy comment in 'searched-lib-generator.run'
(around line 407 of builtin.jam/CVS version), explaining why this is OK.

Alas, two different searched-lib-targets get the same Jam name and the
error above. Moreover, it's not possible to get properties from
searched-lib-target. Ali hit this problem already --- he can't find out what
other libraries searched-lib-target depends on, which is needed to compute
correct order of libraries on gcc's command line.

> Obviously, one can (sometimes) rename the libraries or use
> an 'if' clause (not very elegant).

Yes, this should not be required. I think we need to attach properties to
searched-lib-target instances. The plan is simple:

- remove the long comment in searched-lib-generator.run
- create a 'null-action' instance. That class is used when we only
need to assign properties to targets.
- assign this action instance to searched-lib-target instance, something like:

t = [ new searched-lib-target ... ]
a = [ new null-action $(t) : $(property-set) ] ;
$(t).action $(a) ;
return $(t)

Do you have the inclination to try pushing this outline into a finished patch?
I'll write a regression test, in the meantime.

- 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