Boost logo

Boost-Build :

Subject: Re: [Boost-build] prototyping alternative Boost.Build syntax
From: Vladimir Prus (vladimir.prus_at_[hidden])
Date: 2016-10-28 09:24:46


Stefan,

On 28-Oct-16 4:12 PM, Stefan Seefeld wrote:

(I'd like to prototype a bit with a new (Python)
> syntax, and therefore need to hook up my own parser to feed b2 the
> objects it expects.

If you're doing that, you should be working with Python port, and then,
things are much simpler. b2 is merely starting Python interpreter, and
starts Python code. It also gives Python a few functions to put together
a lowest-level dependency graph.

The code in Jamfiles is intepreted by b2, but it mostly calls Python
functions that that whatever they please. So,

    exe a : a.cpp ;

pretty directly calls this Python function:

https://github.com/boostorg/build/blob/develop/src/build/project.py#L1003

which does:

      return self.manager_.targets().create_typed_target(
                 type, self.registry.current(), name, sources,
                 requirements, default_build, usage_requirements)

Native Python build description would have 'manager' variable injected
in scope, and do exactly the above :-)

-- 
Vladimir Prus
https://vladimirprus.com

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