How to add specific flags to moc in a qmake project?

前端 未结 7 1133
春和景丽
春和景丽 2020-12-19 03:09

I compile a Qt executable using qmake && make on the following project.pro file:

INCLUDEPATH *= ../../dependencies/boost
QT         


        
相关标签:
7条回答
  • 2020-12-19 03:39

    See for example the Qmake docs for variables which details

    • ten different variables in the QMAKE_CFLAGS_* pattern, and

    • ten different variables in the QMAKE_CXXFLAGS* pattern

    and hence I would start with QMAKE_CXXFLAGS which is documented as:

    QMAKE_CXXFLAGS

    This variable contains the C++ compiler flags that are used when building a project. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified. The flags specific to debug and release modes can be adjusted by modifying the QMAKE_CXXFLAGS_DEBUG and QMAKE_CXXFLAGS_RELEASE variables, respectively. Note: On the Symbian platform, this variable can be used to pass architecture specific options to each compiler in the Symbian build system. For example:

    QMAKE_CXXFLAGS.CW += -O2
    QMAKE_CXXFLAGS.ARMCC += -O0 
    

    For more information, see qmake Platform Notes.

    So I'd start with

    QMAKE_CXXFLAGS += -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED

    which you can just add to your .pro file.

    0 讨论(0)
提交回复
热议问题