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

Handle hardcode-dll-paths a little bit differently.

* new/targets.jam
  (basic-target.compute-usage-requirements): Add second parameter 'targets'.

* new/builtin.jam
  (lib-target-class.compute-usage-requirements): Add proper <dll-path>
  properties when <hardcode-dll-paths> in in properties.

  (lib-target.adjust-properties): Don't handle <hardcode-dll-paths>.


[SVN r20441]
This commit is contained in:
Vladimir Prus
2003-10-21 10:44:06 +00:00
parent 1bb41e4189
commit 31f991df08
8 changed files with 70 additions and 48 deletions

View File

@@ -387,12 +387,14 @@ type.register C : c ;
class lib-target-class : basic-target
{
import generators : construct : generators.construct ;
import type ;
import path ;
rule __init__ ( name : project
: sources * : requirements * : default-build * : usage-requirements * )
{
basic-target.__init__ $(name) : $(project)
: $(sources) : $(requirements) : $(default-build) : $(usage-requirements) ;
: $(sources) : $(requirements) : $(default-build) : $(usage-requirements) ;
}
rule construct ( source-targets * : property-set )
@@ -418,15 +420,40 @@ class lib-target-class : basic-target
: $(property-set) : $(source-targets) : LIB ] ;
}
rule compute-usage-requirements ( rproperties )
rule compute-usage-requirements ( rproperties : created-targets )
{
local result = [ basic-target.compute-usage-requirements $(rproperties) ] ;
# For lib targets with <search>, add the value of <search> as <library-path>
# usage requirement.
local search = [ $(rproperties).get <search> ] ;
if $(search)
{
result = [ $(result).add [
property-set.create $(search:G=<library-path>) ] ] ;
}
# If <hardcode-dll-paths> is true, add appropricate <dll-path> usage
# requirements.
local raw = [ $(rproperties).raw ] ;
if <link>shared in $(raw) && <hardcode-dll-paths>true in $(raw)
{
local paths ;
local pwd = [ path.pwd ] ;
for local t in $(created-targets)
{
if [ type.is-derived [ $(t).type ] SHARED_LIB ]
{
paths += [ path.root [ $(t).path ] $(pwd) ] ;
}
}
if $(paths)
{
result = [ $(result).add
[ property-set.create $(paths:G=<dll-path>) ] ] ;
}
}
return $(result) ;
}
@@ -579,13 +606,7 @@ class link-action : action
properties2 += $(p) ;
}
}
local hardcore-rpath ;
if <hardcode-dll-paths>true in $(properties)
{
hardcore-rpath = true ;
}
# Add needed properties
local pwd = [ path.pwd ] ;
local rpaths ;
@@ -608,21 +629,11 @@ class link-action : action
}
}
else
{
if $(hardcore-rpath) &&
[ type.is-derived [ $(s).type ] SHARED_LIB ]
{
rpaths += [ path.root [ $(s).path ] $(pwd) ] ;
}
{
properties2 += <library>$(s) ;
}
}
if $(hardcore-rpath)
{
rpaths = [ sequence.unique $(rpaths) ] ;
properties2 += <dll-path>$(rpaths) ;
}
return $(properties2) ;
}

View File

@@ -947,7 +947,7 @@ class basic-target : abstract-target
create-subvariant-dg $(result) : $(property-set) : $(rproperties) ;
self.generated.$(property-set) =
[ compute-usage-requirements $(rproperties) ]
[ compute-usage-requirements $(rproperties) : $(result) ]
$(result) ;
self.name = $(original-name) ;
@@ -963,7 +963,7 @@ class basic-target : abstract-target
# Given the set of generated targets, and refined build
# properties, determines and sets appripriate usage requirements
# on those targets.
rule compute-usage-requirements ( rproperties )
rule compute-usage-requirements ( rproperties : created-targets * )
{
xusage-requirements = [ $(self.usage-requirements).evaluate-conditionals
$(rproperties) ] ;

View File

@@ -36,7 +36,7 @@ class test-target-class : basic-target
}
}
rule compute-usage-requirements ( rproperties )
rule compute-usage-requirements ( rproperties : targets * )
{
return [ property-set.create <define>FOO ] ;
}

View File

@@ -129,7 +129,7 @@ class stlport-target-class : basic-target
}
rule compute-usage-requirements ( rproperties )
rule compute-usage-requirements ( rproperties : targets * )
{
local usage-requirements ;
usage-requirements +=

View File

@@ -947,7 +947,7 @@ class basic-target : abstract-target
create-subvariant-dg $(result) : $(property-set) : $(rproperties) ;
self.generated.$(property-set) =
[ compute-usage-requirements $(rproperties) ]
[ compute-usage-requirements $(rproperties) : $(result) ]
$(result) ;
self.name = $(original-name) ;
@@ -963,7 +963,7 @@ class basic-target : abstract-target
# Given the set of generated targets, and refined build
# properties, determines and sets appripriate usage requirements
# on those targets.
rule compute-usage-requirements ( rproperties )
rule compute-usage-requirements ( rproperties : created-targets * )
{
xusage-requirements = [ $(self.usage-requirements).evaluate-conditionals
$(rproperties) ] ;

View File

@@ -36,7 +36,7 @@ class test-target-class : basic-target
}
}
rule compute-usage-requirements ( rproperties )
rule compute-usage-requirements ( rproperties : targets * )
{
return [ property-set.create <define>FOO ] ;
}

View File

@@ -387,12 +387,14 @@ type.register C : c ;
class lib-target-class : basic-target
{
import generators : construct : generators.construct ;
import type ;
import path ;
rule __init__ ( name : project
: sources * : requirements * : default-build * : usage-requirements * )
{
basic-target.__init__ $(name) : $(project)
: $(sources) : $(requirements) : $(default-build) : $(usage-requirements) ;
: $(sources) : $(requirements) : $(default-build) : $(usage-requirements) ;
}
rule construct ( source-targets * : property-set )
@@ -418,15 +420,40 @@ class lib-target-class : basic-target
: $(property-set) : $(source-targets) : LIB ] ;
}
rule compute-usage-requirements ( rproperties )
rule compute-usage-requirements ( rproperties : created-targets )
{
local result = [ basic-target.compute-usage-requirements $(rproperties) ] ;
# For lib targets with <search>, add the value of <search> as <library-path>
# usage requirement.
local search = [ $(rproperties).get <search> ] ;
if $(search)
{
result = [ $(result).add [
property-set.create $(search:G=<library-path>) ] ] ;
}
# If <hardcode-dll-paths> is true, add appropricate <dll-path> usage
# requirements.
local raw = [ $(rproperties).raw ] ;
if <link>shared in $(raw) && <hardcode-dll-paths>true in $(raw)
{
local paths ;
local pwd = [ path.pwd ] ;
for local t in $(created-targets)
{
if [ type.is-derived [ $(t).type ] SHARED_LIB ]
{
paths += [ path.root [ $(t).path ] $(pwd) ] ;
}
}
if $(paths)
{
result = [ $(result).add
[ property-set.create $(paths:G=<dll-path>) ] ] ;
}
}
return $(result) ;
}
@@ -579,13 +606,7 @@ class link-action : action
properties2 += $(p) ;
}
}
local hardcore-rpath ;
if <hardcode-dll-paths>true in $(properties)
{
hardcore-rpath = true ;
}
# Add needed properties
local pwd = [ path.pwd ] ;
local rpaths ;
@@ -608,21 +629,11 @@ class link-action : action
}
}
else
{
if $(hardcore-rpath) &&
[ type.is-derived [ $(s).type ] SHARED_LIB ]
{
rpaths += [ path.root [ $(s).path ] $(pwd) ] ;
}
{
properties2 += <library>$(s) ;
}
}
if $(hardcore-rpath)
{
rpaths = [ sequence.unique $(rpaths) ] ;
properties2 += <dll-path>$(rpaths) ;
}
return $(properties2) ;
}

View File

@@ -129,7 +129,7 @@ class stlport-target-class : basic-target
}
rule compute-usage-requirements ( rproperties )
rule compute-usage-requirements ( rproperties : targets * )
{
local usage-requirements ;
usage-requirements +=