mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 13:02:11 +00:00
Fix project loading.
- If we have Jamroot and Jamfile, load both - Actually inherit build-dir from parent. [SVN r64355]
This commit is contained in:
@@ -280,7 +280,8 @@ Attempted to find it with pattern '%s'.
|
||||
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 @@ Please consult the documentation at 'http://boost.org/boost-build2'."""
|
||||
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 @@ Please consult the documentation at 'http://boost.org/boost-build2'."""
|
||||
|
||||
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 @@ actual value %s""" % (jamfile_module, saved_project, self.current_project))
|
||||
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 @@ class ProjectAttributes:
|
||||
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",
|
||||
|
||||
Reference in New Issue
Block a user