Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64355 - trunk/tools/build/v2/build
From: ghost_at_[hidden]
Date: 2010-07-26 05:55:46


Author: vladimir_prus
Date: 2010-07-26 05:55:45 EDT (Mon, 26 Jul 2010)
New Revision: 64355
URL: http://svn.boost.org/trac/boost/changeset/64355

Log:
Fix project loading.

- If we have Jamroot and Jamfile, load both
- Actually inherit build-dir from parent.

Text files modified:
   trunk/tools/build/v2/build/project.py | 18 +++++++++++++-----
   1 files changed, 13 insertions(+), 5 deletions(-)

Modified: trunk/tools/build/v2/build/project.py
==============================================================================
--- trunk/tools/build/v2/build/project.py (original)
+++ trunk/tools/build/v2/build/project.py 2010-07-26 05:55:45 EDT (Mon, 26 Jul 2010)
@@ -280,7 +280,8 @@
 Please consult the documentation at 'http://boost.org/boost-build2'."""
                 % (dir, string.join(self.JAMFILE)))
 
- return jamfile_glob[0]
+ if jamfile_glob:
+ return jamfile_glob[0]
     
     def load_jamfile(self, dir):
         """Load a Jamfile at the given directory. Returns nothing.
@@ -288,10 +289,12 @@
         Effect of calling this rule twice with the same 'dir' is underfined."""
       
         # See if the Jamfile is where it should be.
+ is_jamroot = False
         jamfile_to_load = b2.util.path.glob([dir], self.JAMROOT)
         if not jamfile_to_load:
             jamfile_to_load = self.find_jamfile(dir)
         else:
+ is_jamroot = True
             jamfile_to_load = jamfile_to_load[0]
             
         # The module of the jamfile.
@@ -319,7 +322,12 @@
 
             bjam.call("load", jamfile_module, jamfile_to_load)
             basename = os.path.basename(jamfile_to_load)
-
+
+ if is_jamroot:
+ jamfile = self.find_jamfile(dir, no_errors=True)
+ if jamfile:
+ bjam.call("load", jamfile_module, jamfile)
+
         # Now do some checks
         if self.current_project != saved_project:
             self.manager.errors()(
@@ -482,8 +490,8 @@
              parent_dir = os.path.join(os.getcwd(), parent_location)
 
              build_dir = os.path.join(parent_build_dir,
- b2.util.path.relpath(parent_dir,
- our_dir))
+ os.path.relpath(our_dir, parent_dir))
+ attributes.set("build-dir", build_dir, exact=True)
 
     def register_id(self, id, module):
         """Associate the given id with the given project module."""
@@ -747,7 +755,7 @@
             self.__dict__["source-location"] = source_location
                 
         elif attribute == "build-dir":
- self.__dict__["build-dir"] = os.path.join(self.location, specification)
+ self.__dict__["build-dir"] = os.path.join(self.location, specification[0])
                  
         elif not attribute in ["id", "default-build", "location",
                                "source-location", "parent",


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