diff --git a/src/build-system.jam b/src/build-system.jam index 8bbfe86d3..b79827bef 100644 --- a/src/build-system.jam +++ b/src/build-system.jam @@ -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) ] ; } diff --git a/src/build/project.jam b/src/build/project.jam index d947caf07..c345d8209 100644 --- a/src/build/project.jam +++ b/src/build/project.jam @@ -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 )