سؤال

My .pro file looks as follows:

TEMPLATE    = 
TARGET      = 
DEPENDPATH  += 

HEADERS     += 
FORMS       += 
SOURCES     += 

QT          += 
QT          += 
QT          += 

INCLUDEPATH +=  
INCLUDEPATH += 
INCLUDEPATH += 
INCLUDEPATH += 

LIBS        += 
LIBS        += 
LIBS        += 

CONFIG      += 

Do I still need to use qmake-cxxflags?
In which kind of cases should that flag be used?

هل كانت مفيدة؟

المحلول

qmake-cxxflags is used to pass flags/options to compiler, it depends totally on you as a developer. You can use it to pass optimization settings for example.

Lets assume that you are using the GCC compiler and you want to enable optimization level O3, then you could do this:

QMAKE-CXXFLAGS = -O3

or lets assume that your GCC version of compiler only supports c++11 if certain flag is passed to it, and you want to use the new language features of c++11, so then you could do:

QMAKE-CXXFLAGS = -std=c++11

you can off course use only one QMAKE-CXXFLAGS to pass all your options.

QMAKE-CXXFLAGS = -std=c++11 -O3

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top