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

Bugfix: the 'lib' target used to pass all unused sources to dependents,

which confused Boost.Build.


[SVN r18924]
This commit is contained in:
Vladimir Prus
2003-07-03 07:52:57 +00:00
parent 60e89037fb
commit b4efd4f6a8
4 changed files with 16 additions and 8 deletions

View File

@@ -407,7 +407,7 @@ rule lib-target-class ( name : project
property-set = [ $(property-set).add-raw <main-target-type>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 )

View File

@@ -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) ;
}

View File

@@ -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) ;
}

View File

@@ -407,7 +407,7 @@ rule lib-target-class ( name : project
property-set = [ $(property-set).add-raw <main-target-type>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 )