How can I change the version of boost to use cxxflags = -O2?

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

I am fine with defining a new option if someone can advise me.

+5
source share
2 answers

Just use:

<variant>release:<cxxflags>-O2

as requirements for a top-level design. The parameters specified by cxxflags are passed to gcc after all other parameters, so -O3 will be overridden.

+5
source

I think it’s best to create a new option, for example:

    variant o2release : <cxxflags>-O2 <debug-symbols>off <inlining>full <runtime-debugging>off define=NDEBUG
+1
source

All Articles