c++ - CXXFLAGS modification From My .pro File -


possible duplicate:
configuring gcc compiler switches in qt, qtcreator, , qmake

i use -o1 instead of -o2 in makefile (cflags , cxxflags) linux build, understanding of how these makesfiles generated based on .pro file lacking. because version of qt combined version of g++ using has instabilities when -o2 present.

presently, running replacement script, after run qmake, this:

sed -i 's/\-o2/\-o1/g' allprojects/makefile.release 

this ghetto solution. better solution modify .pro file somehow pass along these directives. not sure how cflags , cxxflags being generated though, , figured ask wonderful stackoverflow.

i have tried passing

linux-g++-{        cflags += -o1       cxxflags += -o1       config += -o1 } 

which did not work.

you close. want is:

qmake_cxxflags += -o1

if apply flags release build, can use this:

qmake_cxxflags_release += -o1

you want change condition little more flexible. in summary, this:

*-g++* {     qmake_cxxflags += -o1 } 

more in documentation here: http://qt-project.org/doc/qt-5.0/qtdoc/qmake-variable-reference.html#qmake-cxxflags


Comments