Boost logo

Boost-Build :

Subject: Re: [Boost-build] How to use alias?
From: áÌÅËÓÅÊ îÉËÉÔÉÎ (alleonik_at_[hidden])
Date: 2010-10-03 15:28:57


2010/10/3 Steven Watanabe <watanabesj_at_[hidden]>
>
> šAMDG
>
> On 10/3/2010 5:54 AM, áÌÅËÓÅÊ îÉËÉÔÉÎ wrote:
>>
>> In documenation write what alias rule may be used for change build
>> properties, but next code fail after command "bjam a_p a_r":
>>
>> lib a.lib : a.cpp ;
>> alias a_p.lib : a.lib :<variant>profile ;
>> alias a_r.lib : a.lib :<variant>release ;
>> install a_p : a_p.lib :<location>. ;
>> install a_r : a_r.lib :<location>. ;
>
> The problem is that you're trying to install two files with
> exactly the same name (a.lib) to the same location.
> You need to either put them in different directories
> or use <tag> to mangle the library names.
>
> In Christ,
> Steven Watanabe
>
Thank you!šBut ohohoh with <tag> code become to evil look :

import type ;
import virtual-target ;

lib a.lib : a.cpp : <tag>@lib_naming ;

install a_p : a_p.lib : <location>. ;
install a_r : a_r.lib : <location>. ;

rule lib_naming ( name : type ? : property-set )
{
š local result ;

š if [ type.is-derived $(type) LIB ]
š {
ššš local variant = [ $(property-set).get <variant> ] ;
ššš if $(variant) = profile
ššš {
ššššš result = $(name)_p ;
ššš } else if $(variant) = release
ššš {
ššššš result = $(name)_r ;
ššš }
ššš result = [ virtual-target.add-prefix-and-suffix $(result)
ššššš : $(type) : $(property-set) ] ;
š }
š return $(result) ;
}

I find another solution :

alias a.lib : a.cpp ;
lib a_p.lib : a.lib : <variant>profile ;
lib a_r.lib : a.lib : <variant>release ;
install a_p : a_p.lib : <location>. ;
install a_r : a_r.lib : <location>. ;

but itšnot allowed to use propertiesšin a.lib...

Best regards,
Alexey Nikitin.


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