Change compilation flags in Qt under Mac OS X?

I installed Qt for Mac and compile my Qt project after adding to the .Pro file

CONFIG(release, debug|release):QMAKE_CXXFLAGS += -O3 -fomit-frame-pointer

to optimize speed.

However, I always see that the command in which g ++ is executed includes -Os, which is optimized for size. I would like to remove it.

I tried several approaches, for example

CONFIG(release, debug|release):QMAKE_CFLAGS_RELEASE -= -Os
CONFIG(release, debug|release):QMAKE_CXXFLAGS -= -Os

and

CONFIG(release, debug|release):QMAKE_CXXFLAGS = -O3 -fomit-frame-pointer
CONFIG(release, debug|release):QMAKE_CFLAGS_RELEASE = -O3 -fomit-frame-pointer
(no +)

But nothing. -O ALWAYS appear.

How to change this?

I found the qmake.conf file in / usr / local / QT 4.5 / mkspecs. It contains the mac-g ++ file. Conf, but I can’t change it, and chmod does not work: chmod: mac-g ++. Conf: operation not allowed

Any ideas?

+3
source share
3 answers

i was able to solve this by editing my project .pro file:

QMAKE_CXXFLAGS_RELEASE -= -O2
QMAKE_CXXFLAGS_RELEASE += -O3

i , , .

+2

qmake .pro.

0

chmod , root (.. ).

:

sudo chmod....

, : , -O3 . , Makefile . , -O3 .

CXXFLAGS Qt Creator, Make. "" " " "" CXXFLAGS = '- O3 -fomit-frame-pointer' " ".

, !

0

Source: https://habr.com/ru/post/1717955/


All Articles