Boost logo

Boost-Build :

Subject: Re: [Boost-build] Upgrading the lexer
From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2018-02-09 13:25:20


On Fri, Feb 9, 2018 at 7:07 AM, Fabien Chêne via Boost-build <
boost-build_at_[hidden]> wrote:

>
> I was wondering if it were possible to extend the bjam grammar so that:
>
> rule lib ( name : sources * : requirements * )
>
> can be called either (possibly using named arguments coming from the
> rule definition):
> lib foo : a.C b.C : requirements <define>XXX ;
> lib foo : sources a.C b.C : requirements <define>XXX ;
> lib foo : requirements <define>XXX : sources a.C b.C ;
> lib sources a.C b.C : name foo : requirements <define>XXX ;
>
> What do you think ?
>

IIRC we discussed this some long time ago.. You example usage is not "easy"
to accomplish in a backward compatible way. The best alternative that I
remember was having the argument names be a special format. For example:

lib foo : a.C b.C :requirements <define>XXX ;
lib foo :sources a.C b.C :requirements <define>XXX ;
lib foo :requirements <define>XXX :sources a.C b.C ;
lib :sources a.C b.C :name foo :requirements <define>XXX ;

That is having named arguments be ":<arg-name> arg .." (colon prefixed).
Which would allow to distinguish them and the list value from all the other
arguments. How does that sound to you?

-- 
-- Rene Rivera
-- Grafik - Don't Assume Anything
-- Robot Dreams - http://robot-dreams.net


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