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

All projects without explicit root are now children of user-config

and user-config is a child of site-config.


[SVN r28095]
This commit is contained in:
Vladimir Prus
2005-04-11 06:35:08 +00:00
parent 62273e9a85
commit ef596cdd64
2 changed files with 82 additions and 43 deletions

View File

@@ -33,34 +33,54 @@ import version ;
local test-config = [ GLOB [ modules.peek : BOOST_BUILD_PATH ] : test-config.jam ] ;
if $(test-config)
{
module test-config
{
import project : _using : using ;
}
import test-config ;
}
if ! $(test-config) && ! --ignore-config in [ modules.peek : ARGV ]
local ignore-config ;
if $(test-config) || --ignore-config in [ modules.peek : ARGV ]
{
module site-config
{
import toolset : using ;
}
ignore-config = true ;
}
module user-config
{
import toolset : using ;
}
local user-path = [ modules.peek : HOME ] [ modules.peek : BOOST_BUILD_PATH ] ;
local user-path = [ modules.peek : HOME ] [ modules.peek : BOOST_BUILD_PATH ] ;
# Load site-config.
module site-config
{
import project : initialize ;
initialize site-config ;
}
if ! $(ignore-config)
{
if [ os.name ] in NT CYGWIN
{
modules.load site-config : : [ modules.peek : SystemRoot ] $(user-path) ;
modules.load user-config : : $(user-path) ;
}
modules.load site-config : : [ modules.peek : SystemRoot ] $(user-path) ;
}
else
{
modules.load site-config : : /etc $(user-path) ;
modules.load user-config : : $(user-path) ;
}
}
# Load user-config.
module user-config
{
import project : initialize ;
initialize user-config ;
}
if ! $(ignore-config)
{
modules.load user-config : : $(user-path) ;
}
if USER_MODULE in [ RULENAMES ]
{
USER_MODULE site-config user-config ;

View File

@@ -379,37 +379,52 @@ rule initialize (
# defined at the end of this file.
modules.clone-rules project-rules $(module-name) ;
# We search for parent/project-root only if jamfile was specified --- i.e
# if the project is not standalone.
if $(location)
{
local parent-module ;
if ! $(basename) in $(JAMROOT)
local parent-module ;
if $(module-name) = site-config
{
# No parent.
}
else if $(module-name) = user-config
{
parent-module = site-config ;
}
else
{
# We search for parent/project-root only if jamfile was specified
# --- i.e
# if the project is not standalone.
if $(location) && ! $(basename) in $(JAMROOT)
{
parent-module = [ load-parent $(location) ] ;
inherit-attributes $(module-name) : $(parent-module) ;
}
local parent ;
if $(parent-module)
}
else
{
parent = [ target $(parent-module) ] ;
}
parent-module = user-config ;
}
}
if $(parent-module)
{
inherit-attributes $(module-name) : $(parent-module) ;
}
local parent ;
if $(parent-module)
{
parent = [ target $(parent-module) ] ;
}
if ! $(.target.$(module-name))
if ! $(.target.$(module-name))
{
.target.$(module-name) = [ new project-target $(module-name)
: $(module-name) $(parent)
: [ attribute $(module-name) requirements ] ] ;
if --debug-loading in [ modules.peek : ARGV ]
{
.target.$(module-name) = [ new project-target $(module-name)
: $(module-name) $(parent)
: [ attribute $(module-name) requirements ] ] ;
if --debug-loading in [ modules.peek : ARGV ]
{
ECHO "Assigned project target" $(.target.$(module-name))
"to '$(module-name)'" ;
}
}
ECHO "Assigned project target" $(.target.$(module-name))
"to '$(module-name)'" ;
}
}
.current-project = [ target $(module-name) ] ;
@@ -420,8 +435,12 @@ rule inherit-attributes ( project-module : parent-module )
{
local attributes = $($(project-module).attributes) ;
local pattributes = [ attributes $(parent-module) ] ;
$(attributes).set parent : [ path.parent
[ path.make [ modules.binding $(parent-module) ] ] ] ;
# Parent module might be locationless user-config.
if [ modules.binding $(parent-module) ]
{
$(attributes).set parent : [ path.parent
[ path.make [ modules.binding $(parent-module) ] ] ] ;
}
$(attributes).set default-build
: [ $(pattributes).get default-build ] ;
$(attributes).set requirements