Boost logo

Boost-Build :

Subject: Re: [Boost-build] b2 option parsing
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2016-10-30 22:34:08


AMDG

On 10/30/2016 08:21 PM, Stefan Seefeld wrote:
> On 30.10.2016 22:12, Stefan Seefeld wrote:
>> On 30.10.2016 22:04, Steven Watanabe wrote:
>>
>>>>>> is there a way to have 'b2' print out the names of those 3 targets, or
>>>>>> even introspect them using the "bjam" module (or some other API for that
>>>>>> matter) ?
>>>>>>
>>>>> -d+12
>>>> Thanks. Is there a way to access that programmatically ?
>>>>
>>> No.
>> If I wanted to add an API for that, where would I start looking ?
>
> To illustrate with a use-case: If I want to implement an automatic
> 'clean' target, I need to know what (other) targets are currently known
> to the system so I can figure out what files they correspond to (if
> any), and thus what artefacts need to be removed.
>

  Boost.Build implements clean by tracking
targets to clean as they are created.
In particular, every time we create a target,
we also run:

common.Clean clean-all : $(actual-targets) ;

  Trying to use Jam's internal target list
for this is not a good idea as it will
include many targets that should not
be cleaned including:
- directories
- NOTFILE targets
- Targets for pre-existing sources and headers.
- multiple targets referring to the same file.
- etc.

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