Scons: Create Late Targets
Solution 1:
The Emitter is not actually there to "build" stuff, like the file TargetFile
in your example. It simply returns which targets will be created or updated, "later on" during the build phase. SCons will take note of this information by storing the "virtual" File (might not physically exist yet) in an internal data structure. This tree is also used later on, when resolving dependencies during the actual build.
Note, that "updating the list of targets and sources via an Emitter" is a completely different task than "building the targets with the single Actions as specified for the current Builder". They don't even have to match, regarding the names of the produced files!
The Emitter runs in the "Parsing phase", but the Builder and its Actions are executed in the "Build phase" (after reading in all SConstructs).
So, if your Tool2_emitter
really requires the target of Tool1 to parse/guess its list of created targets, you're pretty much stuck and won't be able to successfully build in one single run.
So much for the official version. ;) But you can have a look at https://bitbucket.org/scons/scons/wiki/DynamicSourceGenerator which might help you to overcome the restrictions above in your case.
Post a Comment for "Scons: Create Late Targets"