I use meson 0.53.2 on ubuntu 20.04.
I would like to have a maximally optimized executable (-Ofast) but contain all debug symbols (-g3)
- If I use
--buildtype=releaseit optimizes-O2and the executable contains no debug symbol. - If I use
--buildtype=debugit does not optimize at all and uses-g. - If I use
--buildtype=debugoptimizedit optimizes-O2and uses-g.
I tried to use --debug which seems not to work, because the executable does not contain any debug symbol. Instead if I use -Ddebug=true the debug symbols are there but with the flag -g.
So how do I get gcc to compile with -Ofast -g3 flags in the least dirty way possible?