mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 13:02:11 +00:00
Fix prebuilt generators. The prebuilt.py test now passes with Python port.
[SVN r75034]
This commit is contained in:
@@ -399,7 +399,7 @@ class LibGenerator (generators.Generator):
|
||||
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 @@ class LibGenerator (generators.Generator):
|
||||
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 @@ class SearchedLibGenerator (generators.Generator):
|
||||
|
||||
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):
|
||||
|
||||
@@ -58,8 +58,8 @@ class UnixSearchedLibGenerator (builtin.SearchedLibGenerator):
|
||||
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 @@ class UnixPrebuiltLibGenerator (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, 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?
|
||||
|
||||
Reference in New Issue
Block a user