Hello,
I hope add -O2 optimization flag to the .pro file and I did like this:
QMAKE_CXXFLAGS += -o2
But it seems that the Makefile still use -o instead of o2.
Hello,
I hope add -O2 optimization flag to the .pro file and I did like this:
QMAKE_CXXFLAGS += -o2
But it seems that the Makefile still use -o instead of o2.
Don't you mean -O and -O2? -O2 will automatically be added if you compile in release mode. "-o" is for specifying the output file.
Thanks!
Yes, I mean -O2. In debug mode, how can we add this optimization flag from .pro file?
I'm a bit confused as to why you would want to. Normally you want to debug your code whilst in debug mode, so you want the least amount of optimisation possible. Only when your code works would you want to increase optimisation to increase speed.
Adding -O2 to debug build will cause all sorts of problem for debugging. Are you sure sure this is what you want?
Bookmarks