From b4efd4f6a83fdc3ff3ee80fca2d26e5392ff7e84 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 3 Jul 2003 07:52:57 +0000 Subject: [PATCH] Bugfix: the 'lib' target used to pass all unused sources to dependents, which confused Boost.Build. [SVN r18924] --- new/builtin.jam | 2 +- new/generators.jam | 10 +++++++--- v2/build/generators.jam | 10 +++++++--- v2/tools/builtin.jam | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/new/builtin.jam b/new/builtin.jam index 3d5eef533..1f497be20 100644 --- a/new/builtin.jam +++ b/new/builtin.jam @@ -407,7 +407,7 @@ rule lib-target-class ( name : project property-set = [ $(property-set).add-raw LIB ] ; # Construct the target. return [ generators.construct $(self.project) $(self.name) : $(actual-type) - : $(property-set) : $(source-targets) : return-all ] ; + : $(property-set) : $(source-targets) : LIB ] ; } rule compute-usage-requirements ( rproperties ) diff --git a/new/generators.jam b/new/generators.jam index af7700415..08e9e0518 100644 --- a/new/generators.jam +++ b/new/generators.jam @@ -970,9 +970,14 @@ local rule construct-without-caching ( # 'construct' in stack, returns only targets of requested 'target-type', # otherwise, returns also unused sources and additionally generated # targets. +# +# Does not return target which are not of 'allowed-type' or of type derived from +# it. If 'allowed-type' is not specified, it's defaulted to 'target-type'. +# See lib-target-class for use case of this. rule construct ( project name ? : target-type multiple ? : property-set * : sources * - : return-all ? ) + : allowed-type * ) { + allowed-type ?= $(target-type) ; if (.construct-stack) { ensure-type $(sources) ; @@ -1020,8 +1025,7 @@ rule construct ( project name ? : target-type multiple ? : property-set * : sour # is specified. If we don't do this, then all targets calling # 'construct' will get unused target returned, which will break # checking for unused sources a bit harder. - if $(return-all) || - $(type) = $(target-type) || [ type.is-derived $(type) $(target-type) ] + if $(type) = $(target-type) || [ type.is-derived $(type) $(allowed-type) ] { result2 += $(t) ; } diff --git a/v2/build/generators.jam b/v2/build/generators.jam index af7700415..08e9e0518 100644 --- a/v2/build/generators.jam +++ b/v2/build/generators.jam @@ -970,9 +970,14 @@ local rule construct-without-caching ( # 'construct' in stack, returns only targets of requested 'target-type', # otherwise, returns also unused sources and additionally generated # targets. +# +# Does not return target which are not of 'allowed-type' or of type derived from +# it. If 'allowed-type' is not specified, it's defaulted to 'target-type'. +# See lib-target-class for use case of this. rule construct ( project name ? : target-type multiple ? : property-set * : sources * - : return-all ? ) + : allowed-type * ) { + allowed-type ?= $(target-type) ; if (.construct-stack) { ensure-type $(sources) ; @@ -1020,8 +1025,7 @@ rule construct ( project name ? : target-type multiple ? : property-set * : sour # is specified. If we don't do this, then all targets calling # 'construct' will get unused target returned, which will break # checking for unused sources a bit harder. - if $(return-all) || - $(type) = $(target-type) || [ type.is-derived $(type) $(target-type) ] + if $(type) = $(target-type) || [ type.is-derived $(type) $(allowed-type) ] { result2 += $(t) ; } diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index 3d5eef533..1f497be20 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -407,7 +407,7 @@ rule lib-target-class ( name : project property-set = [ $(property-set).add-raw LIB ] ; # Construct the target. return [ generators.construct $(self.project) $(self.name) : $(actual-type) - : $(property-set) : $(source-targets) : return-all ] ; + : $(property-set) : $(source-targets) : LIB ] ; } rule compute-usage-requirements ( rproperties )