Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64635 - in trunk/tools/build/v2: . build test
From: ghost_at_[hidden]
Date: 2010-08-06 08:32:40


Author: vladimir_prus
Date: 2010-08-06 08:32:34 EDT (Fri, 06 Aug 2010)
New Revision: 64635
URL: http://svn.boost.org/trac/boost/changeset/64635

Log:
Fix alternative selection and some error reporting and a test.

Text files modified:
   trunk/tools/build/v2/build/targets.py | 16 ++++++++--------
   trunk/tools/build/v2/build_system.py | 11 ++++++-----
   trunk/tools/build/v2/test/custom_generator.py | 17 +++++++++++++++++
   3 files changed, 31 insertions(+), 13 deletions(-)

Modified: trunk/tools/build/v2/build/targets.py
==============================================================================
--- trunk/tools/build/v2/build/targets.py (original)
+++ trunk/tools/build/v2/build/targets.py 2010-08-06 08:32:34 EDT (Fri, 06 Aug 2010)
@@ -200,7 +200,8 @@
             for t in self.targets_being_built_.values():
                 names.append (t.full_name())
             
- raise Recursion ("Recursion in main target references"
+ get_manager().errors()(
+ "Recursion in main target references\n"
                 "the following target are being built currently: '%s'" % names)
         
         self.targets_being_built_[id(main_target_instance)] = main_target_instance
@@ -667,7 +668,7 @@
         for v in self.alternatives_:
             properties = v.match (property_set, debug)
                        
- if properties:
+ if properties is not None:
                 if not best:
                     best = v
                     best_properties = properties
@@ -725,12 +726,11 @@
         best_alternative = self.__select_alternatives (prop_set, debug=0)
 
         if not best_alternative:
- self.__select_alternatives(prop_set, debug=1)
- raise NoBestMatchingAlternative (
- "Failed to build '%s'\n"
- "with properties '%s'\n"
- "because no best-matching alternative could be found."
- % (self.full_name(), prop_set))
+ # FIXME: revive.
+ # self.__select_alternatives(prop_set, debug=1)
+ self.manager_.errors()(
+ "No best alternative for '%s'.\n"
+ % (self.full_name(),))
 
         result = best_alternative.generate (prop_set)
                     

Modified: trunk/tools/build/v2/build_system.py
==============================================================================
--- trunk/tools/build/v2/build_system.py (original)
+++ trunk/tools/build/v2/build_system.py 2010-08-06 08:32:34 EDT (Fri, 06 Aug 2010)
@@ -155,16 +155,17 @@
 # code in project-target.find but we can not reuse that code without a
 # project-targets instance.
 #
-def _find_target(target_id):
+def find_target(target_id):
 
- m = _target_id_split(target_id)
+ projects = get_manager().projects()
+ m = _target_id_split.match(target_id)
     if m:
- pm = project.find(m.group(1), ".")
+ pm = projects.find(m.group(1), ".")
     else:
- pm = project.find(target_id, ".")
+ pm = projects.find(target_id, ".")
 
     if pm:
- result = project.target(pm)
+ result = projects.target(pm)
 
     if m:
         result = result.find(m.group(2))

Modified: trunk/tools/build/v2/test/custom_generator.py
==============================================================================
--- trunk/tools/build/v2/test/custom_generator.py (original)
+++ trunk/tools/build/v2/test/custom_generator.py 2010-08-06 08:32:34 EDT (Fri, 06 Aug 2010)
@@ -36,6 +36,23 @@
 generators.register-standard rcc.resource-compile : RCC : OBJ ;
 """)
 
+t.write("rcc.py", """
+import b2.build.type as type
+import b2.build.generators as generators
+
+from b2.manager import get_manager
+
+# Use 'RCC' to avoid conflicts with definitions in the standard rc.jam and
+# msvc.jam
+type.register('RCC', ['rcc'])
+
+generators.register_standard("rcc.resource-compile", ["RCC"], ["OBJ"])
+
+get_manager().engine().register_action(
+ "rcc.resource-compile",
+ '@($(STDOUT):E=rc-object) > "$(<)"')
+""")
+
 t.write("jamfile.jam", """
 obj r : r.rcc ;
 """)


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