Boost logo

Boost-Build :

Subject: Re: [Boost-build] Using properties of a concrete target
From: Vladimir Prus (vladimir.prus_at_[hidden])
Date: 2015-09-25 03:17:48


Hi Niklas,

On 19-Sep-15 7:50 PM, Niklas Angare wrote:
> I need to post-process my executable after linking to separate the debug symbols into a separate file, among other
> things. I have a basic version (shown below) working but I would like to make some improvements.

>
> rule postprocess ( target : sources * : properties * )
> {
> if <architecture>x86 in $(properties)
> {
> qnxarch = x86 ;
> }
> else if <architecture>arm in $(properties)
> {
> qnxarch = armv7 ;
> }
>
> toolprefix = nto$(qnxarch)- ;
> }

You can use

        toolprefix on $(<) = nto$(qnxarch)- ;

so that the 'toolprefix' variable is set for a particular engine target, as opposed to
globally.

> rule generate-postprocess ( project name : property-set : source )
> {
> local result ;
>
> # Create a new action
> local a = [ new non-scanning-action $(source) :
> $(__name__).postprocess : $(property-set) ] ;

If you want to use different actions for different architectures, you can do:

        local architecture = [ $(property-set).get <architecture> ] ;

and then create action class with different actions. Is that what you're after?

- 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