It seems that -O2 is always generated unless I specify "optimize-speed" (which results in -O3) or "optimize-size" (which results in -Os) in buildflags. If I specify nothing in buildflags but pass "-O0" into buildoptions the result is "-O2 -O0". The expected result, however, would be just "-O0".
How can I prevent the generation of "-O2" when I pass "-O0" as a custom build option? The documentation mentions nothing relevant.
Probably there is a method to turn -02 off, but it is not necessarry.
From GCC manpage: