How do I set optimization flag on Linux?

Hi, I wonder how to set optimization flag on Linux(Ubuntu) with makefile.

Say, I want to set the optimization level to “-0s”.
Where can I find the current (default) setting and which file should I edit?

Thank you so much in advance!

You should probably post this sort of thing in the Linux section.

However you can find the common Makefiles in “openFrameworks->libs->openFrameworkCompiled->project->makefileCommon”

If you look at config.linux.common.mk and search for PLATFORM_OPTIMIZATION_CFLAGS_RELEASE you’ll find them.

Optimisation is currently set to -03 for release.

If you use QtCreator you should be able to edit the project and add linker options there. Just open the project file with a regular text editor and look for “of.linkerFlags”

2 Likes

Hey @grimus
That’s exactly what I wanted to know.
Thank you so much!