|
Boost-Build : |
Subject: Re: [Boost-build] Specific platform source
From: Gevorg Voskanyan (v_gevorg_at_[hidden])
Date: 2010-07-06 02:27:01
Paulo Márcio Figueiredo Alves wrote:
>>I have this hierarchy on my project:
>
>
> /
> projectA/
> build/
> jamfile
> win/
> a.ccp
> mac/
>> a.cpp
> some.cpp
>
>
> projectB/
> build/
> jamfile
> win/
> b.cpp
> mac/
> b.cpp
> some.cpp
>
>
> jamroot
>
>
>I'd like to know, how to write a rule in my jamroot that gets the right specific platform sources ? And I don't want to call this rule in every jamfile.
>
>
>Thank you.
Assuming you have source-location .. project attribute in every projectx/build/jamfile, you may find the following useful
# Start of jamroot code
project : requirements <conditional>@platform-source ;
rule platform-source ( properties * )
{
local platform-dir = ;
if <target-os>windows in $(properties)
{
platform-dir = win ;
}
if <target-os>darwin in $(properties)
{
platform-dir = mac ;
}
local result = ;
if $(platform-dir)
{
local cpps = [ glob $(platform-dir)/*.cpp ] ;
result = <source>$(cpps) ;
}
return $(result) ;
}
# End of jamroot code
This works good as long as each project is built separately. It fails when attempting to build more than one such project together - I can't say why that happens without digging deep into Boost.Build internals.
Anyway, HTH
Regards,
Gevorg
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