From: Van Nguyen (nguyenhaivan78_at_[hidden])
Date: 2004-11-09 18:09:00
--- In jamboost_at_[hidden], Vladimir Prus <ghost_at_c...> wrote:
> On Monday 08 November 2004 17:16, jeffbenshetler wrote:
> > > > 1. Is there any way to "abstract away" <lib>/<dll>? For
> > > > specify the Boost.Thread library as a dependency I had to add
> > > > <dll>../../thread/build/boost_thread to the sources. On
> > > > static library variant doesn't exist so adding <lib>.. to the
> > > > leads to an error. This is ok, but I need to know/specify more
> > > > absolutely necessary. It would be nice to just say that a
> > depends
> > > > on the thread library and the build system then figures out by
> > > > whether the static or the dynamic variant should be used
> > through
> > > > a preference the user specifies on the command line).
> > >
> > > There is in BBv2, but not really in BBv1. You can however do
> > something like:
> > How does one do this in BBv2? We're just getting started with BB,
> > like it, but we're struggling with library dependencies.
> In V2, you'd write
> exe foo : foo.cpp /boost/threads//boost_threads ;
> You see, there's no <dll> or <lib> there. In fact, there
> has only
> lib boost_threads : ...
> which will build either DLL or LIB depending on the <link>
> <link>shared builds DLL and <link>static builds LIB. I think
> Jamfile for Boost.Thread just requires <link>static, but it surely
> limited to NT only, so that shared library be used on Unix.
> - Volodya
Is it correct that by using
exe foo : foo.cpp /boost/threads//boost_threads ;
everytime "bjam foo --clean", then "bjam foo" is invoked, the whole
boost_threads library source files will be compiled again?
If so, isn't it a better idea to use the dll files instead?
lib boost_thread : <name>boost_thread-mt-1_31 <search>C:/Boost/lib ;
exe foo : foo.cpp boost_thread ;
Especially building with vc7.1 where the dll files are automatically
linked in (ie without having to declare lib threadlib : <name>...
<search>...), using /boost/threads//boost_thread library would waste a
lot of time compiling thread/src/*.cpp files again for no good.
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