cvs diff: Diffing build/v2/tools Index: build/v2/tools/qt4.jam =================================================================== RCS file: /cvsroot/boost/boost/tools/build/v2/tools/qt4.jam,v retrieving revision 1.10 diff -u -r1.10 qt4.jam --- build/v2/tools/qt4.jam 30 Nov 2005 11:18:19 -0000 1.10 +++ build/v2/tools/qt4.jam 8 Dec 2005 19:40:40 -0000 @@ -86,7 +86,10 @@ # The OBJ result type is a fake here too. generators.register [ new moc-h-generator - qt4.moc.cpp : MOCCABLE_CPP : OBJ ] ; + qt4.moc.inc : MOCCABLE_CPP : OBJ ] ; + + generators.register [ new moc-inc-generator + qt4.moc.inc : MOCCABLE_H : OBJ ] ; # Generates .cpp file from qrc file generators.register-standard qt4.rcc : QRC : CPP(qrc_%) ; @@ -250,7 +253,7 @@ name = [ $(sources[0]).name ] ; name = $(name:B) ; - local a = [ new action $(sources[1]) : qt4.moc.cpp : + local a = [ new action $(sources[1]) : qt4.moc.inc : $(property-set) ] ; local target = [ @@ -267,9 +270,39 @@ return $(r) ; } - } + } } +class moc-inc-generator : generator +{ + rule __init__ ( * : * ) + { + generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ; + } + rule run ( project name ? : property-set : sources * ) + { + if ! $(sources[2]) && [ $(sources[1]).type ] = MOCCABLE_H + { + name = [ $(sources[0]).name ] ; + name = $(name:B) ; + + local a = [ new action $(sources[1]) : qt4.moc.inc : + $(property-set) ] ; + + local target = [ + new file-target moc_$(name) : CPP : $(project) : $(a) ] ; + + # Since this generator will return H target, the linking generator + # won't use it at all, and won't set any dependency on it. + # However, we need to target to be seen by bjam, so that dependency + # from sources to this generated header is detected -- if jam does + # not know about this target, it won't do anything. + DEPENDS all : [ $(target).actualize ] ; + + return [ virtual-target.register $(target) ] ; + } + } +} # Query the installation directory # This is needed in at least two scenarios @@ -291,9 +324,10 @@ $(.prefix)/bin/moc -I$(INCLUDES) -D$(DEFINES) -f $(>) -o $(<) } -# When moccing .cpp files, we don't need -f, otherwise generated -# code will include .cpp and we'll get duplicated symbols. -actions moc.cpp +# When moccing files for include only, we don't need -f, +# otherwise the generated code will include the .cpp +# and we'll get duplicated symbols. +actions moc.inc { $(.prefix)/bin/moc -I$(INCLUDES) -D$(DEFINES) $(>) -o $(<) } cvs diff: Diffing build/v2/tools/types Index: build/v2/tools/types/qt.jam =================================================================== RCS file: /cvsroot/boost/boost/tools/build/v2/tools/types/qt.jam,v retrieving revision 1.2 diff -u -r1.2 qt.jam --- build/v2/tools/types/qt.jam 14 Sep 2005 06:26:45 -0000 1.2 +++ build/v2/tools/types/qt.jam 8 Dec 2005 19:40:40 -0000 @@ -5,5 +5,6 @@ type UI : ui ; type QRC : qrc ; type MOCCABLE_CPP ; +type MOCCABLE_H ; # Result of running moc. type MOC : moc : H ;