Boost logo

Boost-Build :

From: Jonathan Biggar (jon_at_[hidden])
Date: 2008-07-18 12:44:35


The generate main target currently only works if you pass it a
<generating-rule> using the '@' construction. If you don't, it silently
just doesn't do anything.

Here's a patch that cleans this up so that it properly gives an error if
it can't run the <generating-rule>, and also just tries to call the rule
via indirect.call if no '@' prefix is found, which allows people to
write wrapper rules that use generate.

-- 
Jon Biggar
Floorboard Software
jon_at_[hidden]
jon_at_[hidden]

==== //depot/orb_main/corba/tools/build/v2/tools/generate.jam#1 (text) - //depot/orb_main/corba/tools/build/v2/tools/generate.jam#3 (text) ==== content
@@ -44,24 +44,35 @@
         local result ;
         local gr = [ $(property-set).get <generating-rule> ] ;
 
- # FIXME: this is copy-paste from virtual-target.jam. Must
- # have n utilty rule to call a rule like this.
- local rule-name = [ MATCH ^@(.*) : $(gr) ] ;
- if $(rule-name)
+ if ($gr)
         {
- if $(tag[2])
+ # FIXME: this is copy-paste from virtual-target.jam. Must
+ # have n utilty rule to call a rule like this.
+ local rule-name = [ MATCH ^@(.*) : $(gr) ] ;
+ if $(rule-name)
+ {
+ if $(gr[2])
+ {
+ errors.error "<generating-rule>@rulename is present but is not the only <generating-rule> feature" ;
+ }
+
+ result = [ indirect.call $(rule-name) $(self.project) $(name)
+ : $(property-set) : $(sources) ] ;
+ }
+ else
             {
- errors.error "<tag>@rulename is present but is not the only <tag> feature" ;
+ result = [ indirect.call $(gr) $(self.project) $(name) : $(property-set) : $sources) ] ;
             }
 
- result = [ indirect.call $(rule-name) $(self.project) $(name)
- : $(property-set) : $(sources) ] ;
-
             if ! $(result)
             {
                 ECHO "warning: Unable to construct" [ full-name ] ;
             }
         }
+ else
+ {
+ errors.error "no <generating-rule> specified" ;
+ }
 
         local ur ;
         local targets ;


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