Boost logo

Boost :

Subject: Re: [boost] [build] Default compiler options for a toolset
From: Edward Diener (eldiener_at_[hidden])
Date: 2013-11-18 15:48:04

On 11/18/2013 3:01 PM, Steven Watanabe wrote:
> On 11/18/2013 10:56 AM, Edward Diener wrote:
>> How are the default compiler options for a toolset chosen ? Is it in the
>> .jam file for the compiler toolset and, if so, where is it specified ?
> Options are specified by toolset.flags in the msvc.jam (for msvc).
> For example:
> flags como-win CFLAGS <inlining>off : --no_inlining ;
> (I'm using como as an example, because it's simple.
> msvc and gcc are a bit more complex, because they
> are designed to handle multiple versions.)
> This says:
> for every target which is created by actions in como-win, if
> the value of the feature <inlining> is set to off, then
> append "--no_inlining" to the variable CFLAGS.
> Then CFLAGS is used like this:
> actions compile.c++
> {
> $(CONFIG_COMMAND) -c ... -D$(DEFINES) $(CFLAGS) ... -o "$(<)" "$(>)"
> }

Thanks for the information, but interpreting the "action" versus the
actual command line generated is difficult for me. Maybe you can help.

As an example here is the action from msvc.jam:

actions compile-c-c++ bind PDB_NAME
     $(.CC) @"@($(<[1]:W).rsp:E="$(>[1]:W)" -Fo"$(<[1]:W)"
$(PDB_CFLAG)"$(PDB_NAME)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))"

or maybe

actions compile-c-c++-pch
     $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)"
-Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)"
$(CC_RSPLINE))" "@($(<[1]:W).cpp:E=#include

Now here is the actual command line generated from a single compile from
running bjam against a preprocessor test using msvc-11.0 with the -d2
option, like 'b2 -d2 toolset=msvc-11.0'.

"tuple.cpp" -Fo"some_long_path\tuple.obj" -TP /Z7 /Od /Ob0 /W4 /GR
/MDd /Zc:forScope /Zc:wchar_t /wd4675 /EHs -c

I am trying to discover where these options in the command line come
from in the actual action. In particular I am trying to discover what in
the action is generating the /EHs option.

Boost list run by bdawes at, gregod at, cpdaniel at, john at