|
Boost-Build : |
From: Matthew Herrmann (matthew.herrmann_at_[hidden])
Date: 2008-02-18 19:48:49
>
> -----Original Message-----
> From: boost-build-bounces_at_[hidden] [mailto:boost-build-bounces_at_[hidden]] On Behalf Of Jurko Gospodnetic
> Sent: Monday, 18 February 2008 2:57 PM
> To: boost-build_at_[hidden]
> Subject: Re: [Boost-build] FW: Generate files in current directory
>
>
> Hi Alex.
>
>
>> > That's how our current build system works.
>>
>
> Hmmm... how about adding an install rule that will automatically copy
> the generated headers to wherever you specify after they get built.
>
> That will allow you place then anywhere, including the source folder
> and will allow Boost Build to track the copied files so it can be smart
> about whether to copy them again on later builds and clean them
> correctly when bjam clean is run.
>
The install sources rule won't correctly trigger rebuilds, since
scanning occurs early. Also, I haven't found any way to force the source
install rule to run before the exe target, so your headers won't be in
their final location when the "exe" rule runs. If you run "bjam" a few
times, though, it will probably work. Bjam also has a bug where changes
to the directory's timestamp trigger rebuilds of all source code. If you
generate a new file into the current directory is running, you'll see
this behaviour.
I'd be curious to see this working with all the dependency tracking, so
that a change to an SQL file triggers a source rebuild, without
explicitly listing every sql file as an implicit dependency in the
jamfile. Something like below would be ideal.
generator g : [ glob *.sql ] ;
exe app : [ glob *.cpp ] g ;
The problem I've had with attempting to implement the above syntax is
that generated code may have dependencies on other headers based on its
*contents*, but the scanning of headers always occurs before any code
gen has been performed. I haven't yet seen any clean way to solve this
in bjam.
The only way I've achieved the above syntax is to patch bjam to disable
file timestamp caching, then run the generator before the include
scanner runs -- ie. in the file-parsing phase. Really ugly, but it
avoids writing out the dependencies for the each source file manually.
Best Regards,
Matthew Herrmann
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