Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-12-06 06:33:40


On Monday 06 December 2004 14:26, Toon Knapen wrote:
> Vladimir Prus wrote:
> > Thanks for explaining. A bugfix and a testcase were just committed.
> > Please let me know if it works for you.
>
> Euhh, no ;-(
> I get following problem (in attach bjam_error.txt) when I launch bjam
> now. The problem is with the 'convert' rule. I'm not sure which
> 'convert' targets.jam wants to call there. Apparantly the one of the
> 'convert-target-class' in the convert.jam (attached). I'm not sure if
> that is correct.

This one is simple. Use the attached convert.jam.

The basic-target.convert now accepts three arguments due to unrelated
refactoring and your version provides only two.

- Volodya
 --Boundary-00=_UOEtBnYuL6AIwLT Content-Type: text/x-java;
charset="koi8-r";
name="convert.jam"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="convert.jam"

# Copyright 2004 Vladimir Prus.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# Defines a 'convert' main target rule, which can be used to convert
# a collection of sources into a desired type. A typical use is
#
# convert objects OBJ : a.cpp b.cpp ;
#
# The difference from
#
# OBJ x : a.cpp b.cpp ;
#
# Is that the latter asks to produce OBJ file is a specific name 'x',
# so won't work with two sources.

import project type targets ;
import "class" : new ;

class convert-target-class : typed-target
{
# import generators property-set ;

rule __init__ ( name : project : type
: sources * : requirements * : default-build * : usage-requirements * )
{
typed-target.__init__ $(name) : $(project) : $(type)
: $(sources) : $(requirements) : $(default-build) : $(usage-requirements) ;
}

rule construct ( name : source-targets * : property-set )
{
local r = [ generators.construct $(self.project) : $(self.type)
: [ property-set.create [ $(property-set).raw ] # [ feature.expand
<main-target-type>$(self.type) ]
# ]
: $(source-targets) : * ] ;
if ! $(r)
{
errors.error "unable to construct" [ full-name ] ;
}
for local t in $(r[2-])
{
$(t).set-intermediate ;
}

return $(r) ;
}

}

rule convert ( name type : sources * : requirements * : default-build *
: usage-requirements * )
{
local project = [ project.current ] ;

# This is a circular module dependency, so it must be imported here
import targets ;
targets.main-target-alternative
[ new convert-target-class $(name) : $(project) : [ type.type-from-rule-name $(type) ]
: [ targets.main-target-sources $(sources) : $(name) ]
: [ targets.main-target-requirements $(requirements) : $(project) ]
: [ targets.main-target-default-build $(default-build) : $(project) ]
: [ targets.main-target-usage-requirements $(usage-requirements) : $(project) ]
] ;
}
IMPORT $(__name__) : convert : : convert ;
 --Boundary-00=_UOEtBnYuL6AIwLT--


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