Boost logo

Boost-Build :

Subject: Re: [Boost-build] Specific platform source
From: Jürgen Hunold (juergen.hunold_at_[hidden])
Date: 2010-07-06 02:25:59


Hi Paulo !

On Monday, 5. July 2010 21:56:05 you wrote:
> I have this hierarchy on my project:
>
> /
> projectA/
> build/
> jamfile
> win/
> a.ccp
> mac/
> a.cpp
> some.cpp

> I'd like to know, how to write a rule in my jamroot that gets the right
> specific platform sources ?

I use the ultimate weapon, the "alias" for this.

alias platform-sources
    : # sources
        win/a.cpp
    : # requirements
         <target-os>windows
   ;

alias platform-sources
    : # sources
        mac/a.cpp
    : # requirements
         <toolset>darwin
   ;

and then

lib a : some.cpp platform-sources ;

Untested example. Hope this helps,

> And I don't want to call this rule in every jamfile .

Then you need more magic.

Yours,

Jürgen

-- 
* Dipl.-Math. Jürgen Hunold       ! Ingenieurgesellschaft für 
* voice: ++49 511 262926 57       ! Verkehrs- und Eisenbahnwesen mbH  
* fax  : ++49 511 262926 99       ! Lister Straße 15
* juergen.hunold_at_[hidden]        ! www.ivembh.de
* 
* Geschäftsführer:                ! Sitz des Unternehmens: Hannover
* Prof. Dr.-Ing. Thomas Siefer    ! Amtsgericht Hannover, HRB 56965
* PD Dr.-Ing. Alfons Radtke       !

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