Boost logo

Boost-Build :

Subject: Re: [Boost-build] cxxflags bug ?
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2012-07-26 08:16:40


On 26 July 2012 12:51, Mateusz Loskot <mateusz_at_[hidden]> wrote:
> On 26 July 2012 12:32, bganesh05_at_[hidden] <bganesh05_at_[hidden]> wrote:
>> Hi,
>>
>> Yes, that's what is my concern.
>
> Please, read the MSDN. There is nothing to be concerned about.
>
>> But t I do not want /O2 to appear again.
>
> Just ignore it.
>
>> To suppress it, I added <toolset>msvc,<variant>release:<cxxflags>"/Ox /Oi /GF
>> /Gy " in project requirements in Jamroot, but /O2 is still coming in the
>> command line.
>
> The /Ox will override the /O2.

One more thing that may invalidate questions you might be aiming to ask now.
You realise that /Ox is identical [1] to /O2, that is why you don't
see the warning
in case of this:

cl /nologo /EHsc /O2 /Ox test.cpp
test.cpp

However, you do see the warning in other cases, for example:

cl /nologo /EHsc /O1 /Ox test.cpp
cl : Command line warning D9025 : overriding '/O1' with '/Ox'
test.cpp

Thus, lack of warning in case of specifying /O2 /Ox
does NOT mean the options overriding mechanism does not work
or Boost.Build is broken.

[1] http://blogs.msdn.com/b/branbray/archive/2005/07/08/437078.aspx
Ot: now turns on optimization, favoring speed (also throws Oi Oy Ob2 GF)
O2: has exactly the same meaning as Ot
Ox: has exactly the same meaning as Ot

Best regards,

-- 
Mateusz Loskot, http://mateusz.loskot.net

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