Boost logo

Boost-Build :

From: Phillip Seaver (phil_at_[hidden])
Date: 2006-07-10 08:15:45


Jorge Suit Perez Ronda wrote:
> Hello,
>
> On Sun, 2006-07-09 at 20:28 +0300, Andrei Melnikov wrote:
>
>> On 07/07/06, Jorge Suit Perez Ronda <josp_at_[hidden]> wrote:
>>
>>> Hello, I'm using
>>>
>>> bjam --version
>>> Boost.Build V2 (Milestone 10)
>>> Boost.Jam 03.1.12
>>>
>>> nightly build, downloaded July, 7 2006
>>>
>>> I'm trying to build a static lib with msvc and I see (with -d2 flag)
>>> that bjam is using the linker flag /MD, is that correct or should it
>>> be /MT? or how can I force the objects file to be compiled with /MT?
>>>
>>> Attached is a simple project to test.
>>>
>>>
>> What command line do you use? /MD is used for runtime-debugging=on,
>> /MT is used for runtime-debugging=off
>>
>>
>
> i typed
>
> bjam -d2 link=static release
>
>
>
>> By default runtime-debugging is on in debug build variant, and off in
>> release build variant.
>>
>> Andrei

Actually, /MT vs. /MD is more a function of the <runtime-link>
attribute. <runtime-link>shared means to link against the DLL C
run-time and <runtime-link>static means to link against the static lib
CRT. It's independent of whether your lib is static or dynamic. Here's
the relevant section of msvc.jam:

    flags msvc.compile CFLAGS
    <runtime-debugging>off/<runtime-link>shared : /MD ;
    flags msvc.compile CFLAGS <runtime-debugging>on/<runtime-link>shared
    : /MDd ;

    flags msvc.compile CFLAGS
    <runtime-debugging>off/<runtime-link>static/<threading>single : /ML ;
    flags msvc.compile CFLAGS
    <runtime-debugging>on/<runtime-link>static/<threading>single : /MLd ;
    flags msvc.compile CFLAGS
    <runtime-debugging>off/<runtime-link>static/<threading>multi : /MT ;
    flags msvc.compile CFLAGS
    <runtime-debugging>on/<runtime-link>static/<threading>multi : /MTd ;

E.g., the first line means that if runtime-debugging is "off" and
runtime-link is "shared", add /MD to the flags. You can find the
variant settings in builtin.jam.

HTH,

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