Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-06-02 01:46:21


Hi,
I've just committed some internal generator changes. They should not affect
ordinary users but in case you're actively extending V2, or just interested in
inner workings, below is complete log message which says what I've done.

Log Message:
Refactor generators a bit.

* If a generator was given a source it could not handle, it used to return
that source together with generated targets. This was nice for some use
cases, but no very nice for others, and this behaviour could not be turned
off. One use case where it worked bad was:

lib plugin : plugin.cpp helper ;
lib helper : helper.cpp ;

On windows, 'plugin' would link to the 'import library' and pass the DLL
target though. So, when installing 'plugin', we'd also install 'helper.dll',
and it was not possible to do anything about it.

* If we asked generators.construct to produce sources of type CPP,
and the selected generator produced both targets of type CPP, and of
some other type, we'd try again to convert those other targets to CPP.
This simply complicated the logic for no good reason.

* Most generator function had 'multiple' parameter, which function
was long forgotten by anybody.

As a bit of history, I believe some of the above decisions were due to a
certain use case:

CPP <------- WHL
\
WD
/
CPP <------- DLP

Here, a source file is converted to two targets with one command, and each
produced file is converted to CPP. Our generators search would notice that
there are two generators for CPP: the WHL->CPP and DPL->CPP
generators. Neither is better that the other so both are tried, and produce
(CPP, DPL) and (CPP, WHL) pairs of targets. To avoid reporting an ambiguity,
we'd try to convert, DLP to CPP and WHL to CPP, do it successfully, notice
that produced targets are the same and decide that there's no ambiguity.

However, this is rather complex logic for a relatively rare case. It can
be handled by writing another WD->CPP generator that would handle
disambiguation itself.

This commit has one user-visible change. The code:

exe a : a.cpp b ;
obj b : b.cpp helper;
lib helper ;

No longer works -- the 'a' target won't link to 'helper'. However, this is
pretty stange code and worked before almost by accident.

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build V2: http://boost.org/boost-build2
 

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