Boost logo

Boost-Build :

From: Andrey Melnikov (melnikov_at_[hidden])
Date: 2005-07-09 14:33:56


David Abrahams wrote:
> Andrey Melnikov <melnikov_at_[hidden]> writes:
>
>>What if I have both msvc 7.1 and 8.0? How should I specify them both
>>in user-config?
>
>
> Easy way:
>
> import msvc-config ;

It doesn't work, because with MSVC 2005 Express Edition Beta 2 the
registry path used for autodetection doesn't exist
>
> "Hard" way:
>
> using msvc : 7.1 ;
> using msvc : 8.0 ;
>
It doesn't work either due to several reasons:

1) msvc 8.0 isn't detected because VS80COMNTOOLS lookup isn't implemented

2) When I specify a path or if I fix the toolset by adding support for
VS80COMNTOOLS, 8.0 works fine. But 7.1 tries to run mt tool which
doesn't exist in 7.1 yet.

It's because the following lines

flags msvc.link MANIFEST : "mt -nologo -manifest " ;
flags msvc.link OUTPUTRESOURCE : "-outputresource:" ;

miss $(condition) and should be

flags msvc.link MANIFEST $(condition) : "mt -nologo -manifest " ;
flags msvc.link OUTPUTRESOURCE $(condition) : "-outputresource:" ;

Also, I think we don't need to specify <toolset> condition in
$(condition) here and in other places where flags rule is executed.
Toolset is already specified by "msvc.compile", isn't it? At least other
toolsets like borland and sun don't specify this condition.

Also I dislike these ugly regex lookups. Why don't we enumerate all
possible values for msvc-version somewhere, so conditions such as
<toolset-version>msvc-6.0 are recognized even if msvc 6.0 isn't used?

In this case we could remove IF statements (and
common.check-init-parameters rule) and just have

flags msvc.link MANIFEST <toolset-version>8.0 : "mt -nologo -manifest " ;
flags msvc.link OUTPUTRESOURCE <toolset-version>8.0 : "-outputresource:" ;

Of course for other version-dependent flags we would have to write

flags msvc.compile CFLAGS <optimization>speed : /O2 ;
flags msvc.compile CFLAGS <toolset-version>6.0/<optimization>speed
<toolset-version>7.0/<optimization>speed
<toolset-version>7.1/<optimization>speed : /Ogity /Gs ;

But I think would be easier to understand because it's more explicit.

Also adding OR syntax would help:

flags msvc.compile CFLAGS <toolset-version>[ 6.0 7.0 7.1
]/<optimization>speed : /Ot ;
flags msvc.compile CFLAGS <toolset-version>[ 6.0 7.0 7.1
]/<optimization>size : /Os ;
flags msvc.compile CFLAGS <toolset-version>[ 6.0 7.0 7.1
]/<optimization>[ speed size ] : /Ogiy /Gs ;

I wonder if we have such syntax now.

Is there any documentation about $(name) and [ ] syntax?

Andrey

 


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