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

Dirk Bächle tshortik at gmx.de
Thu Oct 10 05:59:02 EDT 2013


Hi Henry,

On 10.10.2013 11:36, Henry Gomersall wrote:

> I can't manage to make builds specified through a variant_dir

> correctly handle my auto generated source files.

>


you're probably having the same problem as in:

http://four.pairlist.net/pipermail/scons-users/2013-February/001038.html



> 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.

>


I'd be interested to have a peek at this Tool/Scanner (repo URL?) and
your SConscripts. Would that be possible?



> 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.

>

You shouldn't have to do that.


> 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.

>


When files get created during the build, SCons will rescan all affected
files...so this shouldn't be a problem. Your basic setup looks fine as
it is now and follows the way how implicit dependencies are supposed to
work in SCons.
It's just a minor issue, I guess.

Best regards,

Dirk



More information about the Scons-users mailing list