Boost logo

Boost-Build :

Subject: Re: [Boost-build] problem with tag feature
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-09-16 21:50:26


AMDG

hürcan gökçe Solter wrote:
> Hi there,
> I am trying to use tag feature for the project I have below is the
> rule itself;
>
> <snip>
>
> if i use static everything works fine, but when the type is shared the
> resulting library name is same as if the return value of tag haven't
> used at all

The return value is always an empty list.

The following does what I think you intend (It adds a d to the end of
the names of libraries in debug builds and uses the default otherwise):

rule tag ( name : type ? : property-set )
{
    ECHO $(type) ;
    local tag = ;
    local result = ;
    local suffix = ;
    local properties = [ $(property-set).raw ] ;
    if <variant>debug in $(properties) { tag = d ; }
    if $(type) = SHARED_LIB
    {
        ECHO $(tag)shared ;
        suffix = $(tag).dll ;
    }
    if $(type) = IMPORT_LIB
    {
        ECHO $(tag)shared ;
        local suffix = $(tag).lib ;
    }
    if $(type) = STATIC_LIB
    {
        ECHO $(tag)static ;
        suffix = s$(tag).lib ;
    }
    result = $(name)$(suffix) ;
    ECHO result: $(result) ;
    return $(result) ;
}

In Christ,
Steven Watanabe


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