Boost logo

Boost-Build :

Subject: Re: [Boost-build] Passing <cxxflags>-fPIC with use-project /boost
From: Vladimir Prus (ghost_at_[hidden])
Date: 2009-05-07 11:08:44


On Thursday 07 May 2009 14:07:30 Martin Dyring-Andersen wrote:
> Hello everybody,
>
> I have a Jamroot that looks like this:
>
> project : requirements
> <threading>multi
> <toolkit>gcc,<address-model>64:<cxxflags>-fPIC
> : build-dir stage
> : default-build release
> ;
>
> use-project /boost : dependencies/boost_1_39_0 ;
> use-project /test : test ;
>
> and a Jamfile located in test subdirectory that looks like this:
>
> lib test : [ glob-tree *.cpp ]
> /boost//thread/<link>static
> /boost//date_time/<link>static
> ;
>
> Now, to get the static linking to /boost//thread and date_time working I need to pass -fPIC when building with GCC on 64 bit platforms.
>
> I can see that my own targets in lib sfcg gets compiled with -fPIC, but for some reason the /boost//thread and date_time libraries does not seem to "notice" it.
>
> Everything will work perfectly if I pass cxxflags=-fPIC as a parameter to bjam on the command line. But I would prefer to cram as many details as possible into the Jamfiles, so I don't have to remember them later on ;-).

cxxflags is so called "free" feature -- which is feature which value is not
interpreted. Such features are not propagated to dependencies, for various
reasons. So, you have to use something like:

                 /boost//thread/<link>static/<cxxflags>-fPIC

- Volodya


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