Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-12-03 02:38:35


Anthony Roach wrote:
> On Monday 02 December 2002 02:18 pm, Charles Crain wrote:
>
>>Since an Alias is an "imaginary" thing, it doesn't make sense to include
>>the alias node as a source file (since there IS no file) in the command
>>for building node B. Right?
>
>
> I assumed he was talking about "expanding" the alias into the list of
> filenames it aliases when it gets used in a command. For example:
>
> env.Alias('sources', ['foo.c', 'bar.c'])
>
> ...
>
> env.Program('foo', 'sources')
>
> I'm not sure this is worth the effort though, since this works just as well:
>
>
> sources = ['foo.c', 'bar.c']
>
> ...
>
> env.Program('foo', sources)

Yes, looks equvivalent to me. However, in Boost.Build it makes more sense.
Here's the original example from Rene Rivera:

source test-src-common : source1.cpp source2.cpp ;
source test-src : main-gcc.cpp test-src-common : <toolset>gcc ;
source test-src : main-msvc.cpp test-src-common : <toolset>msvc ;
source test-src : main-darwin.cpp test-src-common : <toolset>darwin ;
exe test : test-src ;

The point is that "test-src" target specifies all sources for "test"
exe, and those sources depend on used toolset. For example,
main-gcc.cpp will be included in "test" only when compiling with gcc.

I believe you can't achieve this effect with simple "if", because Jamfile
is read only one, but you can build with several toolsets.

- 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