mirror of
https://github.com/boostorg/build.git
synced 2026-02-13 12:22:17 +00:00
Boost Build cleanup - added a project.is-jamroot-module() rule (and an accompanying implementation detail project-attributes.is-jamroot() rule) to make testing whether a project module is a Jamroot module cleaner. As 'an example' updated the build-system.should-clean-project() rule to cleanly test for the Jamroot project module instead of assuming that Jamroot module is the one whose parent module is user-config. The old implementation was also incorrect since Jamroot may also have project-config as a parent.
[SVN r79967]
This commit is contained in:
@@ -513,10 +513,10 @@ local rule should-clean-project ( project : detected-projects * )
|
||||
{
|
||||
r = true ;
|
||||
}
|
||||
else
|
||||
else if ! [ project.is-jamroot-module $(project) ]
|
||||
{
|
||||
local parent = [ project.attribute $(project) parent-module ] ;
|
||||
if $(parent) && $(parent) != user-config
|
||||
if $(parent)
|
||||
{
|
||||
r = [ should-clean-project $(parent) : $(detected-projects) ] ;
|
||||
}
|
||||
|
||||
@@ -746,6 +746,16 @@ class project-attributes
|
||||
return $(self.$(attribute)) ;
|
||||
}
|
||||
|
||||
# Returns whether these attributes belong to a Jamroot project module.
|
||||
#
|
||||
rule is-jamroot ( )
|
||||
{
|
||||
if $(self.location) && $(self.project-root) = $(self.location)
|
||||
{
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
|
||||
# Prints the project attributes.
|
||||
#
|
||||
rule print ( )
|
||||
@@ -811,6 +821,14 @@ rule attribute ( project attribute )
|
||||
}
|
||||
|
||||
|
||||
# Returns whether a project module is a Jamroot project module.
|
||||
#
|
||||
rule is-jamroot-module ( project )
|
||||
{
|
||||
return [ $($(project).attributes).is-jamroot ] ;
|
||||
}
|
||||
|
||||
|
||||
# Returns the project target corresponding to the 'project-module'.
|
||||
#
|
||||
rule target ( project-module )
|
||||
|
||||
Reference in New Issue
Block a user