|
Boost-Build : |
Subject: Re: [Boost-build] how to externally specify boost version for a library
From: Juraj Ivanèiæ (juraj.ivancic_at_[hidden])
Date: 2009-06-10 07:04:00
Juraj Ivanèiæ wrote:
> To summarize, I would like to be able to invoke the following command
> line:
>
> bjam myLib boost-version=1.37,1.38,1.39
>
> to get 3 versions of myLib, without having
>
> <boost-version>x:<include>boost_x
>
> inside myLib definition for each boost version I want supported.
I played around a little bit with boost.jam to make this work. I have
added a new rule "boost.use-all" which defines <boost-version> feature
and boost libraries conditionally for each version. It is now possible
to do the following:
-----------------
myLib/Jamroot.jam
-----------------
import boost ;
boost.use-all ;
lib myLib : myLib.cpp /boost//thread ;
-----------------
-----------------
myExe/Jamroot.jam
-----------------
import boost ;
boost.use-all ;
exe myExeWBoost138 : myExe.cpp ../myLib//myLib : <boost-version>1.38 ;
exe myExeWBoost139 : myExe.cpp ../myLib//myLib : <boost-version>1.39 ;
-----------------
It can also be used to specify boost-version from the command line
invocation. I tried to keep boost.jam fully backward compatible but I
would appreciate it if another pair of eyes would verify this.
I also included a little playground I used for testing (pretty much the
myLib/myExe scenario described above). It requires that 1.38 and 1.39
boost versions are configured in user-config.jam.
I hope someone else also finds this feature useful. :)
Juraj Ivanèiæ
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