2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-17 13:42:14 +00:00

Implement ability to have "rootless" projects. With this it is no longer

an error to not have a jamroot file when loading a project. Instead the
top-most jamfile project will operate as the jamroot.
This commit is contained in:
Rene Rivera
2015-06-11 15:31:50 -05:00
parent ab3933bc80
commit f7b59dbf1a

View File

@@ -104,13 +104,10 @@ JAMROOT ?= project-root.jam [Jj]amroot [Jj]amroot.jam ;
rule load-parent ( location )
{
local found = [ path.glob-in-parents $(location) : $(JAMROOT) $(JAMFILE) ] ;
if ! $(found)
if $(found)
{
import errors ;
errors.error Could not find parent "for" project at '$(location)' :
Did not find Jamfile.jam or Jamroot.jam "in" any parent directory. ;
return [ load $(found[1]:D) ] ;
}
return [ load $(found[1]:D) ] ;
}
@@ -457,25 +454,30 @@ rule initialize (
{
parent-module = user-config ;
}
else if $(location) && ! [ MATCH ^($(JAMROOT))$ : $(basename) ]
{
# We search for parent/jamroot only if this is a jamfile project, i.e.
# if is not a standalone or a jamroot project.
parent-module = [ load-parent $(location) ] ;
}
else if $(location)
{
# We have a jamroot project. Inherit from user-config (or project-config
# if it exists).
if $(project-config.attributes)
if ! [ MATCH ^($(JAMROOT))$ : $(basename) ]
{
parent-module = project-config ;
# We search for parent/jamroot only if this is a jamfile project, i.e.
# if is not a standalone or a jamroot project.
parent-module = [ load-parent $(location) ] ;
}
else
if ! $(parent-module)
{
parent-module = user-config ;
# We have a jamroot project, or a jamfile project
# without a parent that becomes a jamroot. Inherit from
# user-config (or project-config
# if it exists).
if $(project-config.attributes)
{
parent-module = project-config ;
}
else
{
parent-module = user-config ;
}
jamroot = true ;
}
jamroot = true ;
}
# TODO: need to consider if standalone projects can do anything but define