Boost logo

Boost-Build :

Subject: [Boost-build] BJam "Duplicate name of actual target" problem
From: Hite, Christopher (Christopher.Hite_at_[hidden])
Date: 2011-07-14 10:12:18


I want to compile two variants of the same program with overlapping
subsets of cpps. I've split up my code so that I don't need any
annoying ifdefs. So my Jamfile looks something like this:

alias shared : [ glob *.cpp ] ;

alias x : [ glob x/*.cpp ] ../libs/xlib//xlib ;
alias y : [ glob y/*.cpp ] ../libs/ylib//ylib ;

exe prog_x : shared x : <include>. ;
exe prog_y : shared y : <include>. ;

1) "Duplicate name of actual target" - The reason why is that xlib/ylib
infect the compilation of files in shared. All the cpps for an exe are
compiled with the same include path.

Yes I've read the faq:
http://www.boost.org/boost-build2/doc/html/bbv2/faq/s02.html

2) I tried was defining shared as a lib. The problem with this is that
shared and x(or y) are circularly dependent.
??? Can I get bjam to pass --start-group --end-group through g++ to ld?

3) A solution would be to define an shared as an obj. The problem here
is if shared has 50 cpp files, each one needs a separate obj in the
Jamfile.
!!! Feature request - and objgroup which would work like lib, so cpp
files in shared wouldn't get settings from x or y.

4) I could try things like feature.feature or variant, but they would
envolve compiling shared twice.

Chris


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