Boost logo

Boost-Build :

Subject: [Boost-build] External library name variants
From: Sebastian Hauer (sebastian.hauer_at_[hidden])
Date: 2008-09-10 16:16:14


Hello,
I am new to boost build and jam and I am trying to setup a project
which makes use of the boost libraries as well as a few other external
pre-build libraries.

What I'm tried to do is link to one or more of the boost libraries.
As you guys probably know boost tags the tool-set runtime etc to the
library name, so for instance unit_test_framework becomes
libunit_test_framework-vc80-mt-gd-1_34_1.

I've created a new project boost in a separate Jamfile and tried added
a pre-build library with a set library <name> .

foo/build/libs/boost/Jamfile.jam:
###########################
project boost
    : usage-requirements
        <include>$(BOOST_INCL)
;

rule boost-lib ( base ) {
  lib $(base)
             :
             : <name>lib$(base)-vc80-mt-gd-$(BOOST_VERSION)
               <search>$(BOOST_LIBS)
  ;
}

boost-lib unit_test_framework ;
###########################

That works. But if I now try to turn the <name> property into a
conditional property like this:

###########################
lib $(base)
             :
             : <toolset-msvc:version>8.0,<threading>multi,<runtime-debugging>on,<variant>debug:<name>lib$(base)-vc80-mt-gd-$(BOOST_VERSION)
               <search>$(BOOST_LIBS)
###########################

I'm getting a rather strange error from bjam:

*** argument error
* rule object(searched-lib-target)@101.__init__ ( name : project :
shared ? : search * : action )
* called with: ( libunit_test_framework-vc80-mt-gd-1_34_1
unit_test_framework : object(project-target)@34 : true :
/c:/dev/boost_1_34_1/lib.x86-nt-msvc8 : object(null-action)@100 : :
: : )
* extra argument unit_test_framework
c:/dev/boost-build-2.0-m12/tools\builtin.jam:341:see definition of
rule '__init__' being called
c:/dev/boost-build-2.0-m12/tools\builtin.jam:575: in
object(searched-lib-generator)@6.run
c:/dev/boost-build-2.0-m12/build\generators.jam:840: in try-one-generator-really
...

I actually don't want to add conditional expressions to handle each
permutation but would rather use something like common.format-name but
I am getting pretty much the same error when I writing an indirect
conditional rule.

What am I doing wrong how do other people deal with multiple variant
builds and external libraries?

Thanks,
Sebastian


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