How to disable compiler optimizations when building through SFDK?

When building a project using sfdk build or through the build button in Qt Creator, something sets CXXFLAGS='-O2 -g …' and CFLAGS to an equivalent value. Is it possible to easily force the compiler to disable the compiler optimisations by removing the -O2 flag and setting the -O0 flag, as it sometimes optimises code out, making it harder to debug with gdb.

Isn’t it enough to just add -O0? No need to remove -O2 afaik.

1 Like

Ah, it seems to work by editing the makefiles/cmake files and making sure to -O0 flag is after the -02.

1 Like