PDA

View Full Version : How to compile with o2 and ob1



freiza
28th February 2015, 20:44
How to set compiler flags. I want to compile my application with
/ob1 and /o2 switches in qt creator. Where should I specify these flags?

ChrisW67
1st March 2015, 03:13
In the PRO file QMAKE_CFLAGS and/or QMAKE_CXXFLAGS and their related variables.

However, you will find that /O2 is the default for a MSVC release build anyway. Setting /Ob1 defeats some of the tools used by /O2.

freiza
1st March 2015, 12:22
I am using mingw.
I wrote it like this but not working.
QMAKE_CSSFLAGS += -O2 \
-Ob1

and this is also not working
QMAKE_CSSFLAGS += /O2 \
/Ob1

wysota
1st March 2015, 13:28
CXXFLAGS and not CSSFLAGS.