views:

45

answers:

2

On my machine cxxflags for variant=release is -O3 by default.
I need to change it to -O2. Please advise how to proceed.

I am fine with defining a new variant as well, if someone could advise me on that.

A: 

I think your best bet is to create a new variant, like this:

    variant o2release : <cxxflags>-O2 <debug-symbols>off <inlining>full <runtime-debugging>off define=NDEBUG
usta
Thanks. I had access to the feature.jam file and I was able to change O3 to O2 for optimization in gcc. That worked as well.
Humble Debugger
Yep, that's also an option when local modification is OK for you :)
usta
A: 

Just use:

<variant>release:<cxxflags>-O2

as requirements on top-level project. Options specified with cxxflags are passed to gcc after all the other options, so -O3 will be overridden.

Vladimir Prus