[Scons-users] Handling implicit dependencies for generated source files in variant dirs
    Henry Gomersall 
    heng at cantab.net
       
    Thu Oct 10 06:51:22 EDT 2013
    
    
  
On 10/10/13 11:39, Dirk Bächle wrote:
> On 10.10.2013 12:16, Henry Gomersall wrote:
>> [...]
>> The tool is here: 
>> https://gist.github.com/hgomersall/6915968#file-jinja-py
>>
> Had a first look right now.
>
>> [...]
>>
>>
>>
>> The templates are actually built from the top level SConstruct file, 
>> using something like the following:
>>
>> c_file = env.Jinja(os.path.join('src', target_c_file), filenames)
>>
> As far as I understood what you said about this Tool, this Builder 
> would also create additional *.h files right?
>
> Then, the problem is clear. Your Builder is missing a proper Emitter, 
> telling SCons which targets exactly result from the call of the 
> Jinja() method. That's why it can't make the proper connection between 
> your auto-generated stuff and the rest of the DAG. 
Apologies, I wasn't quite clear enough. The h files are generated with 
their own explicit call to env.Jinja().
That is, I do the same for the .h file:
h_file = env.Jinja(os.path.join(source_dir, target_h_file),
             os.path.join(template_dir, target_source_name + '.h.jinja'))
There is no side effect of creating the .h file, so I assumed that the 
dependency is inferred from that call...?
Cheers,
Henry
    
    
More information about the Scons-users
mailing list