|
Boost-Build : |
From: Arvid Norberg (arvid.norberg_at_[hidden])
Date: 2020-10-28 09:51:06
Hi. I'm having an issue I haven't been able to pin-point where it goes
wrong. I want to declare a lib rule that refers to a pre-built library.
Typically this is done in this form:
lib foobar : : <search>/my/library/path <name>library-name ;
However, I want the <name> to be computed by some more sophisticated logic.
To do this, I define a rule ("my-condition") and I replace
"<name>library-name" with "<conditional>@my-condition".
Here's a complete reproducer Jamfile:
import feature : feature ;
feature my-version : : free ;
rule my-condition ( properties * )
{
local ver = [ feature.get-values <my-version> : $(properties) ] ;
local my-lib = "foobar" [ SPLIT_BY_CHARACTERS $(ver) : "." ] ;
return <name>$(my-lib:J) ;
}
lib foobar : : <conditional>@my-condition ;
The rule my-condition produces a name of "foobar123", if <my-version>1.2.3
is set.
Running b2 produces the following error:
$ b2 my-version=1.2.3
boost_1_73_0/tools/build/src/kernel/class.jam:90: in new
*** argument error
* rule class_at_searched-lib-target.__init__ ( name : project : shared ? :
search * : action )
* called with: ( foobar foobar123 : object(project-target)@209 : true : :
object(null-action)@228 : : : : : : : : : : : : : : )
* extra argument foobar123
boost_1_73_0/tools/build/src/tools/generators/searched-lib-generator.jam:70:see
definition of rule 'class_at_searched-lib-target.__init__' being called
boost_1_73_0/tools/build/src/tools/generators/searched-lib-generator.jam:48:
in searched-lib-generator.run
boost_1_73_0/tools/build/src/tools/unix.jam:113: in
class_at_unix-searched-lib-generator.run
boost_1_73_0/tools/build/src/build/generators.jam:1019: in
try-one-generator-really
boost_1_73_0/tools/build/src/build/generators.jam:1081: in try-one-generator
boost_1_73_0/tools/build/src/build/generators.jam:1319: in construct-really
boost_1_73_0/tools/build/src/build/generators.jam:1405: in
generators.construct
boost_1_73_0/tools/build/src/tools/generators/lib-generator.jam:59: in
class_at_lib-generator.run
boost_1_73_0/tools/build/src/build/generators.jam:1019: in
try-one-generator-really
boost_1_73_0/tools/build/src/build/generators.jam:1081: in try-one-generator
boost_1_73_0/tools/build/src/build/generators.jam:1319: in construct-really
boost_1_73_0/tools/build/src/build/generators.jam:1405: in
generators.construct
boost_1_73_0/tools/build/src/build/targets.jam:1615: in construct
boost_1_73_0/tools/build/src/build/targets.jam:1364: in
class_at_basic-target.generate
boost_1_73_0/tools/build/src/build/targets.jam:812: in generate-really
boost_1_73_0/tools/build/src/build/targets.jam:784: in
class_at_main-target.generate
boost_1_73_0/tools/build/src/build/targets.jam:273: in
class_at_project-target.generate
boost_1_73_0/tools/build/src/build-system.jam:797: in load
boost_1_73_0/tools/build/src/kernel/modules.jam:295: in import
boost_1_73_0/tools/build/src/kernel/bootstrap.jam:139: in boost-build
boost_1_73_0/tools/build/boost-build.jam:8: in module scope
It's as if the <name> feature somehow is interpreted as the name of the lib
rule, rather than a feature that's part of its properties.
-- Arvid Norberg
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk