Boost logo

Boost-Build :

Subject: Re: [Boost-build] prototyping alternative Boost.Build syntax
From: Stefan Seefeld (stefan_at_[hidden])
Date: 2016-10-29 15:45:05


On 29.10.2016 15:39, Vladimir Prus wrote:
>
> Stefan,
>
>> I have done this:
>>
>> ...
>> bjam_interface = __import__('bjam')
>> bjam_interface.define_action("gcc.compile", "g++ -c -o $(<) $(>)",
>> [], 0)
>> bjam_interface.call("gcc.compile", "hello.o", "hello.cpp")
>> #return b2.build_system.main()
>>
>> (I assume the invocation of 'b2.build_system.main()' is responsible for
>> locating Jamfiles and doing all the other stuff that I'd like to skip
>> when interfacing with the low-level API, yes ?)
>>
>> This doesn't seem to do anything at all. At least it doesn't generate
>> "hello.o", and doesn't print any (error) message either. Is there any
>> command-line option I can use to cause the execution to be traced (I
>> tried "-d+2" and "--debug-building" with no visible effect).
>
> Try adding two further lines:
>
> bjam_interface.call("UPDATE_NOW", "hello.o")
> bjam_interface.call("UPDATE")

Cool, that worked ! Can you outline what the four calls do ?

    bjam_interface.define_action("gcc.compile", "g++ -c -o $(<) $(>)",
[], 0)
    bjam_interface.call("gcc.compile", "hello.o", "hello.cpp")
    bjam_interface.call("UPDATE_NOW", "hello.o")
    bjam_interface.call("UPDATE")

from my guess:

* the first line defines an action
* the second line defines a rule by which "hello.o" is made from
"hello.cpp" using that action
* the third line requests "hello.o" to be remade ("now" - is that a
blocking call ?)
* not sure about the fourth line

Many thanks,
        Stefan

-- 
      ...ich hab' noch einen Koffer in Berlin...

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