|
Boost-Build : |
Subject: [Boost-build] How to stop propagating properties to dependents.
From: Alexey Pakhunov (alexeypa_at_[hidden])
Date: 2009-03-30 12:47:29
Hi,
This topic has been brought up a couple of time already. See
http://lists.boost.org/boost-build/2009/02/21272.php for instance.
Say I have a dependency chain: A -> B -> C -> D. I.e. target A depends on B
and so on. Currently whatever (propagated) requirements target A has they
will be propagated down to B, C and D even if the generators B -> C and C ->
D are not using them. This can lead to multiple variants of D to be built
even if it it not necessary. Consider the following example:
make header : source : @generate_header ;
actions generate_header
{
echo foobar > $(<)
}
lib foo : foo.c : <implicit-dependency>header ;
lib bar : bar.c : <implicit-dependency>header <exception-handling>off ;
exe rabbit : foo bar rabbit.c ;
In this "make header" will be run twice: once for a property set with
<exception-handling>off and once for a property set without it. It is not
needed because the result produced by "make header" does not depend on the
value of <exception-handling> feature.
It seems this can be solved relatively easily. If generators could filter
passed property sets and remove anything they are not interested. This way
"make header" could remove all properties it does not use and generate a
single copy of the header. The method "generator::run" seems to be the only
place where a property set is passed so the filtering can happen there.
Do you think it is a right direction to move to solve this issue?
-- Best regards, Alexey Pakhunov.
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