0

I my trying to run a project using waf which uses boost library . To overcome a problem I need to pass and -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED argument to MOC. I tried doing so in the wscript as

   bld(features ='cxx',
       source   ='GSTEngine.cpp',
       target   = 'GSTEngine.o',
       includes = qtinc+gstinc+taginc,use=['BOOST'],
       uselib   = qtlibs,
       cxxflags = ['-DQT_NO_KEYWORDS','-DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED'])

but it failed. How to pass argument to MOC using waf?

Matt Clarkson
  • 14,106
  • 10
  • 57
  • 85
Vihaan Verma
  • 12,815
  • 19
  • 97
  • 126
  • Are you sure these need to be passed to moc? They look like generic defines and should be defined via "bld(..., defines=['QT_NO_KEYWORDS', 'BOOST_TT_HAS_OPERATOR_HPP_INCLUDED'], ...)" as can be seen at http://docs.waf.googlecode.com/git/book_16/single.html section 9.1.2 – drahnr Jul 10 '12 at 17:20

1 Answers1

0

The possible issue here is that waf invokes a new task for moc that may not carry the same cxxflags as the task generator that you have defined above.

A possible fix would be to add the defines to the waf environment like so:

conf.env.append_unique('DEFINES',
    ['QT_NO_KEYWORDS','BOOST_TT_HAS_OPERATOR_HPP_INCLUDED'])

If you would just like to add the defines to the moc task you could implement a custom feature and add it to your task generator that digs out the moc task and adds the defines.

Matt Clarkson
  • 14,106
  • 10
  • 57
  • 85