Boost logo

Boost-Build :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2005-07-05 23:32:13

Valentin Samko wrote:
> I am trying to adapt bbv2 to use it instead of existing build system
> for a large project, and one of the requirements is to be able to have several
> libraries/projects with the same name, but different version numbers.
> I am happy to add new bjam rules for these requirements, but I am not
> sure I understand how to write these rules. I found <version> feature
> and corresponding rules in \v2\build\modifiers.jam with a small example
> in \v2\example\versioned\jamfile.jam. What exactly does this future do,
> and how can it be used?

Well since I wrote those I guess I have to answer, somewhat. First as
you perhaps saw by the copyright date I wrote that a long time ago,
can't believe it's been two years already, so it's a bit rusty. Second,
I just checked and the code doesn't work as it's using the old style
class syntax. Third, I'm not sure even fixing the syntax would make it
work since so much of BBv2 has changed since then. Having said that...
The intent of that code was to generalize the manipulations that happen
to a target based on features and some specific rules. Basically it
transforms some set of features into a transformation of the target, in
the singular case implemented changing the name based on the version
feature. This is something I did internally in BBv1 after the 2nd or 3rd
time I rewrote the equivalent, for example templates are implemented
with this, but it's still PITA in BBv1.

> Does it let user have several projects with
> the same name, but different version numbers (or at least several libraries with
> the same name)?

Yes, or at least it did once upon a time. But this was not really an
aspect of the modifiers.jam extension but of the overall handling of
features in BBv2 which differentiates between all of:

lib hello : hello.cpp : <version>1.0 ;
lib hello : hello.cpp : <version>1.1 ;
lib hello : hello.cpp : <version>2.0 ;
lib hello : hello.cpp : <version>2.1 ;

Although you should be able to do that regardless of the use of
modifiers.jam as version is a regular feature. I would hope Volodya is
using this feature for versioning as that's what it's for.

> Also, is it possible to write a rule/feature which will modify the list of all
> the dependencies of the current executable? How?

Neat.. That's exactly the kind of thing modifiers are designed for.
Don't know if there's some other way to do it, at least as dynamically
as modifiers. But you could specify multiple executables, based on the
<version>, and you could specify a different set of libraries, sources,
etc. for each:

exe hello : hello1.cpp : <version>1.0 ;
exe hello : hello1.cpp : <version>1.1 ;
exe hello : hello2.cpp : <version>2.0 ;
exe hello : hello2.cpp : <version>2.1 ;

-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. -
-- rrivera/ - grafik/
-- 102708583/icq - grafikrobot/aim - Grafik/

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at