Boost logo

Boost-Build :

Subject: [Boost-build] How can I pass vars to actions
From: Jose . (kasty.jose_at_[hidden])
Date: 2014-03-20 14:10:44


I read the BBv2 documentation and samples. I don't want to create my own
generator, just to see "Hola" "Adios" as the output of this program:

rule myecho
{
    _MSG on $(<) = $(MSG) ;
}
actions myecho bind _MSG
{
    echo "MSG = $(_MSG)" ;
}

constant MSG : "hola" ;
make Hola : : @myecho ;

constant MSG : "adios" ;
make Adios : : @myecho ;

Why I only see "adios" "adios" ? I guess it's because the variable inside
the action is not evaluated until the action executes. But the rule myecho
should be executed in the first pass, hence _MSG should contain "Hola" for
target Hola, and "Adios" for target Adios.

Am I missing anything? How can I pass a different message to a Make rule
depending on the target? Can I avoid creating a generator?

Regards.



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