|
Boost-Build : |
From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-01-22 07:36:59
Juergen Hunold wrote:
> Hi Volodya !
>
> On Friday 21 January 2005 17:08, Vladimir Prus wrote:
>
>>Some time ago we've discussed how best to apply naming conversion to
>>target names, such as 'd' letters for debug builds. I've committed
>>some changes resulted from that discussion.
>>
>>Here is the summary of changes:
>
>>The <tag> feature now must be present only once in build properties,
>>and its value must the have the form '@rule.name'. The mentioned rule
>>will be called to compute the name of each created virtual target
>>that has <tag> in properties.
>>
>>The rule should match this prototype:
>>
>> rule name ( name : type ? : property-set )
>
> Volodya, could you please add an example for this ?
> I admit I'm lost :-)
I presume it is something like (not tested):
# Jamfile
rule simple-target ( name : type ? : property-set )
{
return "" ; # use default name
}
# debug/release pseudo-code
rule variant-target ( name : type ? : property-set )
{
modifier = "-";
if <variant> in property-set
{
switch property-set:<variant>
{
case "release" : name += "r" ;
case "debug" : name += "d" ;
case "profile" : name += "p" ;
}
}
if "$(modifier)" == "-"
{
modifier = "" ; # no modifiers selected
}
return name + modifier ;
}
using:
exe app1 : ... : <tag>@rule.simple-target ;
exe hello : .. : <tag>@rule.variant-target ;
stage dist : app1 hello ;
and:
bjam release gcc-3.3
will produce:
dist/app1.exe
dist/hello-r.exe
bjam debug gcc-3.3
will produce:
dist/app1.exe
dist/hello-d.exe
Is this right?
>>Things left to do:
>>- rename 'stage' to 'install'
>>- implement proper versioning support for dynamic libraries
>
> That would be cool.
Seconded. I would also like to propose having a default <tag> rule, like
my simple-target above, as well as having several common implementations
(in a target.jam?) This would make it easier to say:
exe app : ... : <tag>@target.boost-target ; # -dm-gcc3_3
Also, how about having <tag> being heirarchial, where you can specify it
in a project decleration to say all targets in this project use these
rules (e.g. boost), while allowing you to override this in sub-projects
(e.g. examples use standard-target rules), targets (this target uses
variant-target rules) and stage rules (e.g. this stage uses boost naming
rules). Thoughts?
It might be useful to have a short-hand for simple-target, something
like <tag>"".
Regards,
Reece
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