Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-01-26 06:34:34


Zbynek Winkler wrote:
> Vladimir Prus wrote:
> > Hi Zbynek,
> >
> >>When I make library foo depend on library bar I get a warning
> >>
> >>targets.jam:1014: in check-for-unused-sources from module...
> >>warning: Unused source.... bar.cpp in main target ./foo...
> >>
> >>Why is that? Am I doing something wrong? The jamfile is plain simple
> >>
> >>lib foo : foo.cpp bar ;
> >>lib bar : bar.cpp ;
> >
> > That's no what I'm getting.
>
> Ok, I forgot something. Try 'bjam link=static'

I still get a warning about unused library, not 'bar.cpp'. Anyway, I've
comitted a change which eliminates that warning. Maybe, you can try the
attached patch?

- Volodya
 --Boundary-00=_KtPFAI55fuygxSZ Content-Type: text/x-diff;
charset="iso-8859-1";
name="libraries_unused.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="libraries_unused.diff"

Index: builtin.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/builtin.jam,v
retrieving revision 1.129
diff -u -r1.129 builtin.jam
--- builtin.jam 13 Jan 2004 10:18:09 -0000 1.129
+++ builtin.jam 26 Jan 2004 11:32:07 -0000
@@ -414,6 +414,23 @@
return $(result) ;
}

+ rule check-for-unused-sources ( result * : sources * )
+ {
+ # For library targets, it's okay to bypass input sources of
+ # type LIB: with <link>static we can't consume library.
+
+ local sources-to-check ;
+ for local s in $(sources)
+ {
+ if ! [ type.is-derived [ $(s).type ] LIB ]
+ {
+ sources-to-check += $(s) ;
+ }
+ }
+ basic-target.check-for-unused-sources $(result) : $(sources-to-check) ;
+ }
+
+
}

rule lib ( name : sources * : requirements * : default-build *
 --Boundary-00=_KtPFAI55fuygxSZ--


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