Boost logo

Boost-Build :

Subject: Re: [Boost-build] Get setup command from msvc toolset
From: Phillip Seaver (phil_at_[hidden])
Date: 2009-04-30 11:06:27


Алексей Бадяев wrote:
> Hi All!
> I need get Microsoft Visual C++ compiler setup command from msvc.jam
> toolset of Boost Build v2.
> Without setup command I can't run DUMPBIN utilite.
> Can I get that command for use in my Jamfile?
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost-build

Here's something I wrote a while ago to do that. It's probably not the
best way to do it, but it worked for me:

    local vers ;
    local bats ;
    local info = [ modules.peek toolset : .msvc.compile.flags ] ;
    for local fn in $(info)
    {
        if [ modules.peek toolset : .msvc.compile.variable.$(fn) ] = ".CC"
        {
            local ver = [ MATCH ".*toolset-msvc:version.([^/ ]+)" :
                [ modules.peek toolset : .msvc.compile.condition.$(fn) ] ] ;
            vers += $(ver[1]) ;
            local bat = [ MATCH "call \"([^\"]+)\"" :
                [ modules.peek toolset : .msvc.compile.values.$(fn) ] ] ;
            bats += $(bat) ;
        }
    }
    ECHO "vers =" $(vers) ;
    ECHO "bats =" $(bats) ;

For msvc-8.0, you'll get multiple values, because there are different
compile options for different architectures, but they should have the
same batch file. Here's what I get:

vers = 8.0 8.0 8.0 8.0 7.1
bats = C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat
C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat C:\Program
Files\Microsoft Visual Studio 8\VC\vcvarsall.bat C:\Program
Files\Microsoft Visual Studio 8\VC\vcvarsall.bat C:\Program
Files\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat

Phillip


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