2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 01:12:13 +00:00

Remove support for using project-root.jam in place of Jamfile.

* new/project-roots.jam
  (project-root-context.project): Remove.

* new/project.jam
  (find): Simplify.
  (find-jamfile): Optimize.


[SVN r20432]
This commit is contained in:
Vladimir Prus
2003-10-21 06:12:49 +00:00
parent 27255fc93b
commit 27feec6546
12 changed files with 82 additions and 106 deletions

View File

@@ -300,19 +300,7 @@ module project-root-context
return $(.project-root) ;
}
}
# First, makes this project-root.jam module acts as project, which, in
# particular means that project-context rules will be imported in the
# current module.
# Second, invokes 'project' again --- this time it will be rule
# from project-context.
rule project ( * : * )
{
import project ;
project.act-as-jamfile $(__name__) : [ project-root get-location ] ;
project $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
}
# Declare and set a project global constant. Project global constants are
# normal variables but should not be changed. They are applied to each
# Jamfile that is loaded under it's corresponding project-root.

View File

@@ -117,21 +117,10 @@ rule find ( name : current-location )
# root, willing to act as Jamfile. In that case, project-root
# must be placed in the directory referred by id.
local root-location =
[ project-roots.find-project-root $(location) ] ;
if $(root-location)
if [ find-jamfile $(location) ]
{
root-location = [ path.parent $(root-location) ] ;
}
if $(location) in $(.project-location) ||
[ find-jamfile $(location) ] && [ load $(location) ] ||
$(root-location) = $(location) && [ project-roots.load $(location) ]
{
# We've managed to find or load project. Returns the module
# name
project-module = [ module-name $(location) ] ;
}
project-module = [ load $(location) ] ;
}
}
return $(project-module) ;
@@ -176,12 +165,21 @@ local rule find-jamfile (
local jamfile-glob = ;
if $(parent-root)
{
jamfile-glob =
[ path.glob-in-parents $(dir) : $(JAMFILE) : $(parent-root) ] ;
if ! $(.parent-jamfile.$(dir))
{
.parent-jamfile.$(dir) =
[ path.glob-in-parents $(dir) : $(JAMFILE) : $(parent-root) ] ;
}
jamfile-glob = $(.parent-jamfile.$(dir)) ;
}
else
{
jamfile-glob = [ path.glob $(dir) : $(JAMFILE) ] ;
if ! $(.jamfile.$(dir))
{
.jamfile.$(dir) = [ path.glob $(dir) : $(JAMFILE) ] ;
}
jamfile-glob = $(.jamfile.$(dir)) ;
}
return $(jamfile-glob) ;

View File

@@ -10,7 +10,8 @@ from BoostBuild import Tester, List
t = Tester()
t.write("project-root.jam", """
t.write("project-root.jam", "")
t.write("Jamfile", """
project ;
exe hello : hello.cpp a.c ;

View File

@@ -0,0 +1,21 @@
# This project-root.jam also serves the role of Jamfile
project lib3 ;
use-project /lib2/helper : ../lib2/helper ;
import property ;
rule mfc-compile ( target : sources * : property-set * )
{
PROPERTIES on $(target) = [
property.as-path [ property.remove incidental : $(property-set) ] ] ;
}
actions mfc-compile
{
echo $(PROPERTIES) > $(<)
echo $(>) >> $(<)
}
make f.obj : f.cpp /lib2/helper//e.obj : mfc-compile ;

View File

@@ -1,21 +0,0 @@
# This project-root.jam also serves the role of Jamfile
project lib3 ;
use-project /lib2/helper : ../lib2/helper ;
import property ;
rule mfc-compile ( target : sources * : property-set * )
{
PROPERTIES on $(target) = [
property.as-path [ property.remove incidental : $(property-set) ] ] ;
}
actions mfc-compile
{
echo $(PROPERTIES) > $(<)
echo $(>) >> $(<)
}
make f.obj : f.cpp /lib2/helper//e.obj : mfc-compile ;

View File

@@ -10,7 +10,8 @@ from BoostBuild import Tester, List
# Test that free property inside
t = Tester()
t.write("project-root.jam", """
t.write("project-root.jam", "")
t.write("Jamfile", """
project ;
variant debug-AA : debug : <define>AA ;

View File

@@ -300,19 +300,7 @@ module project-root-context
return $(.project-root) ;
}
}
# First, makes this project-root.jam module acts as project, which, in
# particular means that project-context rules will be imported in the
# current module.
# Second, invokes 'project' again --- this time it will be rule
# from project-context.
rule project ( * : * )
{
import project ;
project.act-as-jamfile $(__name__) : [ project-root get-location ] ;
project $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
}
# Declare and set a project global constant. Project global constants are
# normal variables but should not be changed. They are applied to each
# Jamfile that is loaded under it's corresponding project-root.

View File

@@ -117,21 +117,10 @@ rule find ( name : current-location )
# root, willing to act as Jamfile. In that case, project-root
# must be placed in the directory referred by id.
local root-location =
[ project-roots.find-project-root $(location) ] ;
if $(root-location)
if [ find-jamfile $(location) ]
{
root-location = [ path.parent $(root-location) ] ;
}
if $(location) in $(.project-location) ||
[ find-jamfile $(location) ] && [ load $(location) ] ||
$(root-location) = $(location) && [ project-roots.load $(location) ]
{
# We've managed to find or load project. Returns the module
# name
project-module = [ module-name $(location) ] ;
}
project-module = [ load $(location) ] ;
}
}
return $(project-module) ;
@@ -176,12 +165,21 @@ local rule find-jamfile (
local jamfile-glob = ;
if $(parent-root)
{
jamfile-glob =
[ path.glob-in-parents $(dir) : $(JAMFILE) : $(parent-root) ] ;
if ! $(.parent-jamfile.$(dir))
{
.parent-jamfile.$(dir) =
[ path.glob-in-parents $(dir) : $(JAMFILE) : $(parent-root) ] ;
}
jamfile-glob = $(.parent-jamfile.$(dir)) ;
}
else
{
jamfile-glob = [ path.glob $(dir) : $(JAMFILE) ] ;
if ! $(.jamfile.$(dir))
{
.jamfile.$(dir) = [ path.glob $(dir) : $(JAMFILE) ] ;
}
jamfile-glob = $(.jamfile.$(dir)) ;
}
return $(jamfile-glob) ;

View File

@@ -10,7 +10,8 @@ from BoostBuild import Tester, List
t = Tester()
t.write("project-root.jam", """
t.write("project-root.jam", "")
t.write("Jamfile", """
project ;
exe hello : hello.cpp a.c ;

View File

@@ -0,0 +1,21 @@
# This project-root.jam also serves the role of Jamfile
project lib3 ;
use-project /lib2/helper : ../lib2/helper ;
import property ;
rule mfc-compile ( target : sources * : property-set * )
{
PROPERTIES on $(target) = [
property.as-path [ property.remove incidental : $(property-set) ] ] ;
}
actions mfc-compile
{
echo $(PROPERTIES) > $(<)
echo $(>) >> $(<)
}
make f.obj : f.cpp /lib2/helper//e.obj : mfc-compile ;

View File

@@ -1,21 +0,0 @@
# This project-root.jam also serves the role of Jamfile
project lib3 ;
use-project /lib2/helper : ../lib2/helper ;
import property ;
rule mfc-compile ( target : sources * : property-set * )
{
PROPERTIES on $(target) = [
property.as-path [ property.remove incidental : $(property-set) ] ] ;
}
actions mfc-compile
{
echo $(PROPERTIES) > $(<)
echo $(>) >> $(<)
}
make f.obj : f.cpp /lib2/helper//e.obj : mfc-compile ;

View File

@@ -10,7 +10,8 @@ from BoostBuild import Tester, List
# Test that free property inside
t = Tester()
t.write("project-root.jam", """
t.write("project-root.jam", "")
t.write("Jamfile", """
project ;
variant debug-AA : debug : <define>AA ;