[Scons-users] Handling implicit dependencies for generated source files in variant dirs

Henry Gomersall heng at cantab.net
Thu Oct 10 05:36:57 EDT 2013


I can't manage to make builds specified through a variant_dir correctly
handle my auto generated source files.

The nodes are built using a suitable tool (a Jinja tool to which I
referred in slightly earlier email). I can then build a list of the
returned nodes from that tool.

My current strategy is to create an explicit dependency between those
nodes of the auto generated files and those nodes explicitly created
(which I return) in the SConscript call (the one with the
variant_dir='foo'). Now this strategy doesn't work unless I also set
duplicate=0. The first run will fail with a missing .h file. Subsequent
runs (with no modifications) work fine.

I guess that because the .c file that depends on the (also
autogenerated) .h file doesn't exist until the actual build takes place,
the scanner can't detect that dependency on the .h file, and so the .h
is not copied into the variant dir. The SConscript file builds a
SharedLibrary from a Glob('*.c') which builds a dependency list
including the '.c' files because it knows that the code generator tool
will return .c files.

The .h file _is_ however in the list of filenodes. Is there some way in
which the variant dir can be advised of this dependency explicitly (and
so copies it across as desired)?

Cheers,

Henry




More information about the Scons-users mailing list