[Solved] QMake and optimization flags for compiler
-
wrote on 2 May 2012, 05:49 last edited by
I'm using Qt Creator and find out that in default, g++ will use -O2 for compiling phase and -O1 for linking phase. I have add -O3 to both QMAKE_CXXFLAGS and LIBS but end up with there both -O3 -O2 in compiling phase and -O1 -O3 in linking phase. Is there a way to control the optimization flags in .pro files?
-
wrote on 2 May 2012, 14:50 last edited by
@
QMAKE_CXXFLAGS_RELEASE -= -O2
QMAKE_CXXFLAGS_RELEASE += -O3QMAKE_LFLAGS_RELEASE -= -O1
@
Make sure you've re-run qmake after modifying your .pro file. -
wrote on 2 May 2012, 14:52 last edited by
Oh. I never thought of "-=" operator. Thank you very much.
1/3