Boost logo

Boost-Build :

Subject: Re: [Boost-build] Generating multiple CPP/H targets from a single source
From: Tyson Marchuk (tmarchuk_at_[hidden])
Date: 2010-08-04 15:27:18


  Thanks for the reply Volodya.

I looked at the Generated headers section in the documentation, and I
tried adding <implicit-dependency> to my Jamfile, but this doesn't seem
to be solution. The generated files are in the same main target as the
files that include them so according to the documentation this should be
handled automatically.

My Jamfile (names changed) is just:
<code>
exe testQtAndCodeGenerator
    :
    SourceForCodeGenerator.idl
    AQt4Dialog.ui
    AQt4DialogWrapper.h
    AQt4DialogWrapper.cxx
    AnotherQt4Class.h
    AnotherQt4Class.cxx
    main.cxx
    /qt4//QtCore
    /qt4//QtGui
    /codeGenerator//codeGenerator
    : <include>.
    ;

install bindir : testQtAndCodeGenerator : <location>../bin ;
</code>

Note above that the code generator will turn SourceForCodeGenerator.idl
into:
SourceForCodeGenerator.h
SourceForCodeGeneratorPlugin.h
SourceForCodeGeneratorSupport.h
SourceForCodeGenerator.cpp
SourceForCodeGeneratorPlugin.cpp
SourceForCodeGeneratorSupport.cpp

These headers will be included in the other source files in the project.

Maybe this feature was added in a later version of Boost.Build? I'm
using milestone 10. I will try to see if I can reproduce the problem
with the latest version and if so I'll try to create a small example
with a fake perl script or something for the code generator (the code
generator I'm trying to use is proprietary and licensed.)

Thanks again,
-Tyson

On 2010/08/04 1:07 PM, Vladimir Prus wrote:
> Tyson Marchuk wrote:
>
>> Well it turns out that it's only 'mostly working'. There is a problem
>> where if files in the project include the generated H files then doing a
>> build with a high number of jobs (-j10 for example) won't wait for my
>> generator to finish before processing and the file won't exist when it
>> comes time to compile the other source (CPP) files. The weird thing is
>> that if I touch the source IDL, XML, etc. file then it will rebuild
>> these files so it seems to know about the dependency but won't force a
>> wait on completion of the first 6 targets before continuing on.
>>
>> To clarify I have a file of type MYGEN which makes 3 CPP and 3 H files.
>> These 3 H files are included in other, normal, CPP files. If I update
>> the MYGEN file the normal CPP files get rebuilt as a result of the H
>> files getting rebuilt but if I do bjam --clean and then bjam -j10 it
>> will attempt to build the normal CPP files without waiting to generate
>> the dependencies from the MYGEN file.
>>
>> Does anyone have any advice on how to modify the generator so that it's
>> guaranteed to finish before things that include the output targets are
>> built? I've been playing around a bit with DEPENDS and INCLUDES rules
>> without any luck.
>>
> Are you sure you set<implicit-dependency> properties on other targets?
> See 'generated files' section in the docs.
>
> - Volodya
>
>
> _______________________________________________
> Unsubscribe& other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
>
>


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk