Boost logo

Boost-Commit :

From: ghost_at_[hidden]
Date: 2007-09-01 18:10:47


Author: vladimir_prus
Date: 2007-09-01 18:10:46 EDT (Sat, 01 Sep 2007)
New Revision: 39105
URL: http://svn.boost.org/trac/boost/changeset/39105

Log:
Previously, I've accidentally committed a patch
to make <tag> affect names of searched libraries.
This commit greatly simplifies that.

Text files modified:
   trunk/tools/build/v2/build/virtual-target.jam | 93 +++++++++++++++------------------------
   trunk/tools/build/v2/tools/builtin.jam | 8 ---
   trunk/tools/build/v2/tools/types/lib.jam | 4 +
   3 files changed, 41 insertions(+), 64 deletions(-)

Modified: trunk/tools/build/v2/build/virtual-target.jam
==============================================================================
--- trunk/tools/build/v2/build/virtual-target.jam (original)
+++ trunk/tools/build/v2/build/virtual-target.jam 2007-09-01 18:10:46 EDT (Sat, 01 Sep 2007)
@@ -378,18 +378,40 @@
                         
             return l$(location-grist) ;
         }
- }
-
- # Applies the <tag> feature to the specified name,
- # and returns the new name. If there no <tag>
- # or <tag> rule retuend nothing, return empty string.
- # 'ps' is the property set to be used when calling
- # the 'tag' rule. Typically, that should be
- # obtained from 'tag-properties'.
- rule apply-tag ( specified-name : ps )
+ }
+
+ # Given the target name specified in constructor, returns the
+ # name which should be really used, by looking at the <tag> properties.
+ # The tag properties come in two flavour:
+ # - <tag>value,
+ # - <tag>@rule-name
+ # In the first case, value is just added to name
+ # In the second case, the specified rule is called with specified name,
+ # target type and properties and should return the new name.
+ # If not <tag> property is specified, or the rule specified by
+ # <tag> returns nothing, returns the result of calling
+ # virtual-target.add-suffix
+ rule _adjust-name ( specified-name )
     {
+ local ps ;
+ if $(self.action)
+ {
+ ps = [ $(self.action).properties ] ;
+ }
+ else
+ {
+ ps = [ property-set.empty ] ;
+ }
+
+ #~ We add ourselves to the properties so that any tag rule can get
+ #~ more direct information about the target than just that available
+ #~ through the properties. This is useful in implementing
+ #~ name changes based on the sources of the target. For example to
+ #~ make unique names of object files based on the source file.
+ #~ --grafik
+ ps = [ property-set.create [ $(ps).raw ] <target>$(__name__) ] ;
+
         local tag = [ $(ps).get <tag> ] ;
- local result ;
 
         if $(tag)
         {
@@ -401,7 +423,7 @@
                     errors.error "<tag>@rulename is present but is not the only <tag> feature" ;
                 }
                 
- result = [ indirect.call $(rule-name) $(specified-name) :
+ self.name = [ indirect.call $(rule-name) $(specified-name) :
                   $(self.type) : $(ps) ] ;
             }
             else
@@ -409,57 +431,14 @@
                 errors.error
                   "The value of the <tag> feature must be '@rule-nane'" ;
             }
- }
- return $(result) ;
- }
-
- rule tag-properties ( )
- {
- local ps ;
- if $(self.action)
- {
- ps = [ $(self.action).properties ] ;
- }
- else
- {
- ps = [ property-set.empty ] ;
         }
-
         
- #~ We add ourselves to the properties so that any tag rule can get
- #~ more direct information about the target than just that available
- #~ through the properties. This is useful in implementing
- #~ name changes based on the sources of the target. For example to
- #~ make unique names of object files based on the source file.
- #~ --grafik
- ps = [ property-set.create [ $(ps).raw ] <target>$(__name__) ] ;
-
- return $(ps) ;
- }
-
- # Given the target name specified in constructor, returns the
- # name which should be really used, by looking at the <tag> properties.
- # The tag properties come in two flavour:
- # - <tag>value,
- # - <tag>@rule-name
- # In the first case, value is just added to name
- # In the second case, the specified rule is called with specified name,
- # target type and properties and should return the new name.
- # If not <tag> property is specified, or the rule specified by
- # <tag> returns nothing, returns the result of calling
- # virtual-target.add-suffix
- rule _adjust-name ( specified-name )
- {
- local ps = [ tag-properties ] ;
-
- self.name = [ apply-tag $(specified-name) : $(ps) ] ;
- # If tag rule does not exists or returned nothing,
- # just add prefix/suffix.
- if ! $(self.name)
+ # If there's no tag or the tag rule returned nothing.
+ if ! $(tag) || ! $(self.name)
         {
             self.name = [ virtual-target.add-prefix-and-suffix
                 $(specified-name) : $(self.type) : $(ps) ] ;
- }
+ }
     }
 
     rule actualize-no-scanner ( )

Modified: trunk/tools/build/v2/tools/builtin.jam
==============================================================================
--- trunk/tools/build/v2/tools/builtin.jam (original)
+++ trunk/tools/build/v2/tools/builtin.jam 2007-09-01 18:10:46 EDT (Sat, 01 Sep 2007)
@@ -337,15 +337,9 @@
         : action
     )
     {
- abstract-file-target.__init__ $(name) exact : SEARCHED_LIB : $(project)
+ abstract-file-target.__init__ $(name) : SEARCHED_LIB : $(project)
           : $(action) : ;
         
- local rn = [ apply-tag $(name) : [ tag-properties ] ] ;
- if $(rn)
- {
- self.name = $(rn) ;
- }
-
         self.shared = $(shared) ;
         self.search = $(search) ;
     }

Modified: trunk/tools/build/v2/tools/types/lib.jam
==============================================================================
--- trunk/tools/build/v2/tools/types/lib.jam (original)
+++ trunk/tools/build/v2/tools/types/lib.jam 2007-09-01 18:10:46 EDT (Sat, 01 Sep 2007)
@@ -26,3 +26,7 @@
 type SHARED_LIB : so : LIB ;
 
 type SEARCHED_LIB : : LIB ;
+# This is needed so that when we create a target of SEARCHED_LIB
+# type, there's no prefix or suffix automatically added.
+type.set-generated-target-prefix SEARCHED_LIB : : "" ;
+type.set-generated-target-suffix SEARCHED_LIB : : "" ;


Boost-Commit 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