Boost logo

Boost-Build :

Subject: Re: [Boost-build] Can not parse compile flags on to other jam file
From: Vladimir Prus (ghost_at_[hidden])
Date: 2011-03-28 13:30:21


On Monday, March 28, 2011 21:11:08 Gevorg Voskanyan wrote:
> Bo Jensen wrote:
> > In another thread this problem appeared, but I never got it to work :
> ><library>../../../external/boost/libs/chrono/build//<link>static/<cxxflags
> >>-fPIC
> >
> ><library>../../../external/boost/libs/serialization/build//<link>static/<c
> >xxflags>-fPIC
> >
> > First one with chrono works fine but serialization and other libraries
> > fails when forcing compiler flags :
> >
> > /home/bj/sulum/external/boost/tools/build/v2/build/virtual-target.jam:107
> > 9: in virtual-target.register-actual-name from module virtual-target
> >
> > error: Duplicate name of actual target:
> ><p/home/bj/sulum/external/boost/bin.v2/libs/serialization/build/intel-linu
> >x/release/address-model-32/link-static/threading-multi>libboost_serializat
> >ion.a a
>
> [snip]
>
> > error: created from
> > /home/bj/sulum/external/boost/libs/serialization/build/boost_serializatio
> > n error: added properties: <cxxflags>-fPIC
> > error: removed properties: none
> >
> >
> > Most likely very simple, but a show-stopper for me, any help ?
>
> Bo,
>
> If that's urgent for you I can suggest a workaround, but there might be a
> better solution.
> Here it goes:
>
> import feature ;
> feature.feature fpic : off on : propagated optional composite ;
> feature.compose <fpic>on : <cxxflags>-fPIC ;
>
>
> <library>../../../external/boost/libs/chrono/build//<link>static/<fpic>on
>
> <library>../../../external/boost/libs/serialization/build//<link>static/<fp
> ic>on

Well, there's no better solution really. The error means that serialization is
being built twice, with and without <cxxflags>-fPIC. Since <cxxflags> can have
pretty much random value, we don't encode it in target path, so we can't honor
such request. Using a feature with fixed values allows Boost.Build to
generate unique paths for serizliation lib with and without that option.

- Volodya

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build: http://boost.org/boost-build2

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