Boost logo

Boost-Build :

From: Michael Stevens (Michael.Stevens_at_[hidden])
Date: 2003-07-24 05:15:47


Dear all,

For a long time I believed that multiply defined main targets didn't
work. Finally I have tracked the problem down to an interaction with
project build defaults.

At present the following will unexpectedly (for me at least!) fail with
the error "default build can be specified only in first alternative".

project : : default-build debug ;
lib zlib : : <name>z <variant>release ;
lib zlib : : <name>z_d <variant>debug ;

The problem is that this is equivilent to

lib zlib : : <name>z <variant>release : debug ;
lib zlib : : <name>z_d <variant>debug : debug ;

which is explicitly disallowed. Only the first definition is allowed to
define a default build.

It seems logical that the above two definitions should be identical.
Therefore I think the best fix is to weaken the current check. Instead I
propose that the default builds must be identical in multiple main
target definitions.

The following patch implements this weaker check and modifies the error
message appropriately.

All the best,
Michael

Weaken multiple main target default build check. Must be identical
rather then only defined on first.

RCS file: /cvsroot/boost/boost/tools/build/new/targets.jam,v
retrieving revision 1.106
diff -U3 -r1.106 targets.jam
--- targets.jam 21 Jul 2003 08:30:19 -0000 1.106
+++ targets.jam 24 Jul 2003 09:57:34 -0000
@@ -374,15 +374,17 @@
rule add-alternative ( target )
{
local d = [ $(target).default-build ] ;
- if $(self.alternatives) && [ $(d).raw ]
+ if $(self.alternatives) && ( [ $(self.default-build).raw ] != [
$(d).raw ] )
{
- errors.error "default build can be specified only in first
alternative"
- : "main target is " [ full-name ] ;
+ errors.error "default build must be identical in all
alternatives"
+ : "main target is" [ full-name ]
+ : "with" [ $(self.default-build).raw ]
+ : "differing from previous default build" [ $(d).raw ] ;
}
else
{
self.default-build = $(d) ;
}
self.alternatives += $(target) ;
}

 


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