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.
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.
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