Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-01-23 06:54:04

I'm somewhat uncomfortable with current "default build" semantics.
First, we allow several alternatives for a main target.

exe foo : foo.cpp foo_gcc.cpp : <toolset>gcc ;
exe foo : foo.cpp foo_borland.cpp : <toolset>borland ;

Both of them can declare default build, but if those default build
are different, the whole system will break. Default build should
be at least assigned to *main target*, but not *alternative*. I've no
suggestions for UI, though.

Another problem was discovered just now. Jamfile reads

: default-build <uses>qt

build-project main ;
build-project lib1 ;

Clearly, if I run "bjam" the effect should be the same as if I've explicitly
run it with "bjam uses=qt". That's not the case: the "default-build" setting
is inherited by targets in "main" and "lib1" and take effect only when those
targets are generated. In particular, if "lib1/lib1" is used by "main/hello",
then "lib1/lib1" will be build without "<uses>qt".

This all leads me to the following suggestion:
1. Default-build can be specified per-project only
2. When project is build without explicit build reuqest "bjam", and it
specifies some default build, the behaviour is as if default build
was specified on the command line. In this case, default-build settings
on child projects are ignored.
3. If there are neither properties on command line nor default build
in current project, then... default properties are used. Default build
on child projects are ignored.

Note that default-build attribute of project is still inherited. In top-level
project defines default-build, and invoking "bjam" without parameters anywhere
in the project tree will use the default-build from top-level project.

However, this design precludes per-target default build. I think it's not a
big problem: if building two different versions of the same program is really
needed by default, one can introduce auxilliary target.

source aux : lib1/<variant>release lib1/<variant>debug ;

OTOH, in default settings top-level project will decide what variats to build.


- Volodya


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