You can edit qmakespec, which is used by your configuration.
The easiest way to find this is to open
%QTDIR%\mkspecs\%QMAKESPEC%
Assuming environment variables are set (they should be)
Just in case, it does not work, it will be something like C:\Qt\4.xx\mkspecs\win32-msvc2010
In the qmake.conf file, you can configure the following two lines (they are in different places in the file)
QMAKE_CFLAGS_RELEASE = -O2 -MT QMAKE_CFLAGS_LTCG = -GL
to
QMAKE_CFLAGS_RELEASE = -MT QMAKE_CFLAGS_LTCG =
However, keep in mind that you will need to do this for each version of Qt used (and for each future update you will do).
[Change]
If you want to have -O2 -GL options for specific projects, you will need to add
QMAKE_CFLAGS_RELEASE += -O2 QMAKE_CFLAGS_LTCG += -GL
into the .pro file of projects that need these parameters.
Depending on the number of projects that use it and those that donβt, this approach or overriding QMAKE_CFLAGS will be more convenient.
source share