|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75034 - trunk/tools/build/v2/tools
From: ghost_at_[hidden]
Date: 2011-10-18 04:59:40
Author: vladimir_prus
Date: 2011-10-18 04:59:38 EDT (Tue, 18 Oct 2011)
New Revision: 75034
URL: http://svn.boost.org/trac/boost/changeset/75034
Log:
Fix prebuilt generators. The prebuilt.py test now passes with Python port.
Text files modified:
trunk/tools/build/v2/tools/builtin.py | 35 +++++++++++++++++------------------
trunk/tools/build/v2/tools/unix.py | 8 ++++----
2 files changed, 21 insertions(+), 22 deletions(-)
Modified: trunk/tools/build/v2/tools/builtin.py
==============================================================================
--- trunk/tools/build/v2/tools/builtin.py (original)
+++ trunk/tools/build/v2/tools/builtin.py 2011-10-18 04:59:38 EDT (Tue, 18 Oct 2011)
@@ -399,7 +399,7 @@
SHARED_LIB.
"""
- def __init__(self, id = 'LibGenerator', composing = True, source_types = [], target_types_and_names = ['LIB'], requirements = []):
+ def __init__(self, id, composing = True, source_types = [], target_types_and_names = ['LIB'], requirements = []):
generators.Generator.__init__(self, id, composing, source_types, target_types_and_names, requirements)
def run(self, project, name, prop_set, sources):
@@ -432,7 +432,9 @@
def viable_source_types(self):
return ['*']
-generators.register(LibGenerator())
+generators.register(LibGenerator("builtin.lib-generator"))
+
+generators.override("builtin.prebuilt", "builtin.lib-generator")
def lib(names, sources=[], requirements=[], default_build=[], usage_requirements=[]):
"""The implementation of the 'lib' rule. Beyond standard syntax that rule allows
@@ -508,22 +510,19 @@
generators.register (SearchedLibGenerator ())
-### class prebuilt-lib-generator : generator
-### {
-### rule __init__ ( * : * )
-### {
-### generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
-### }
-###
-### rule run ( project name ? : prop_set : sources * : multiple ? )
-### {
-### local f = [ $(prop_set).get <file> ] ;
-### return $(f) $(sources) ;
-### }
-### }
-###
-### generators.register
-### [ new prebuilt-lib-generator builtin.prebuilt : : LIB : <file> ] ;
+class PrebuiltLibGenerator(generators.Generator):
+
+ def __init__(self, id, composing, source_types, target_types_and_names, requirements):
+ generators.Generator.__init__ (self, id, composing, source_types, target_types_and_names, requirements)
+
+ def run(self, project, name, properties, sources):
+ f = properties.get("file")
+ return f + sources
+
+generators.register(PrebuiltLibGenerator("builtin.prebuilt", False, [],
+ ["LIB"], ["<file>"]))
+
+generators.override("builtin.prebuilt", "builtin.lib-generator")
class CompileAction (virtual_target.Action):
Modified: trunk/tools/build/v2/tools/unix.py
==============================================================================
--- trunk/tools/build/v2/tools/unix.py (original)
+++ trunk/tools/build/v2/tools/unix.py 2011-10-18 04:59:38 EDT (Tue, 18 Oct 2011)
@@ -58,8 +58,8 @@
def optional_properties (self):
return self.requirements ()
- def run (self, project, name, prop_set, sources, multiple):
- result = SearchedLibGenerator.run (project, name, prop_set, sources, multiple)
+ def run (self, project, name, prop_set, sources):
+ result = SearchedLibGenerator.run (project, name, prop_set, sources)
set_library_order (sources, prop_set, result)
@@ -69,10 +69,10 @@
def __init__ (self, id, composing, source_types, target_types_and_names, requirements):
generators.Generator.__init__ (self, id, composing, source_types, target_types_and_names, requirements)
- def run (self, project, name, prop_set, sources, multiple):
+ def run (self, project, name, prop_set, sources):
f = prop_set.get ('<file>')
set_library_order_aux (f, sources)
- return (f, sources)
+ return f + sources
### # The derived toolset must specify their own rules and actions.
# FIXME: restore?
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