Boost logo

Boost-Build :

Subject: [Boost-build] Conditional compilation and lib dependency
From: John Bito (jwbito_at_[hidden])
Date: 2009-04-07 20:49:56


I'm trying to sort out how to compile a sub-project in two different ways
(the conditional code is controlled by -DJAVA). I'll make two different
libaries (foo & foo_java). The question is how to let the boost-build know
that there are distinct sets of objects even though the sources are
identical.

lib foo : s1.c s2.c ;

lib foo_java : s1.c s2.c : <define>JAVA ;

The above is what I'm inclined to utter, but I get complaints about
Duplicate name of actual target: <pbin/sun/debug/link-static>s1.o

Other projects would say:

exe bar : bar.c ..//foo

exe baz: baz.c ..//foo_java

Of course, I'd like to refactor the code so that it isn't littered with
conditions, but I hope that isn't a prerequisite to migrating from make to
bjam.



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