Boost logo

Boost-Build :

From: emildotchevski (emildotchevski_at_[hidden])
Date: 2005-08-04 02:02:59


--- In jamboost_at_[hidden], Vladimir Prus <ghost_at_c...> wrote:
> On Thursday 04 August 2005 09:24, emildotchevski wrote:
> > This is a question about using different cpp files in a given lib
> > depending on the target platform.
>
> Does
>
> lib your_lib : nt/a.cpp : <os>NT ;
> lib your_lib : linux/a.cpp : <os>LINUX ;
>
> work for you? Note that you'd need nightly snapshot, or CVS
version of V2
> for this to work sensibly.
>
> HTH,
> Volodya
>
> --
> Vladimir Prus
> http://vladimir_prus.blogspot.com
> Boost.Build V2: http://boost.org/boost-build2

Yes I tried this and it did work, thanks. I was trying something
along the lines of:

lib mylib : [ glob *.cpp ] [ glob $(OS)/*.cpp ] ;

which I believe didn't work.

So my question now is, isn't it possible to avoid writing a target
per OS? I mean, the behavior for the different values of OS is the
same (just the name of the folder with additional files changes) so
ideally I'd like to use a single target to describe that behavior.

And to make it perfect, I'd like to parameterize the behavior and
leave the jamfiles for each lib to just provide the name of the lib,
like so:

simple-lib mylib ;

And then simple-lib would expand to something like:

lib $(lib-name) : [ glob *.cpp ] [ glob $(OS)/*.cpp ;

It seems the documentation suggests that this should be possible but
somehow I can't get it to work... I am using the latest nightly
build of boost-build.zip.

Thanks,
Emil

 


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