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=release
it optimizes-O2
and the executable contains no debug symbol. - If I use
--buildtype=debug
it does not optimize at all and uses-g
. - If I use
--buildtype=debugoptimized
it optimizes-O2
and 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?