[Scons-users] find new targets from other targets?

Scott Johnson scott.johnson at arilinc.com
Sun Feb 23 22:07:47 EST 2020


Yes, evaluating the if's is what Jinja does, and that's how the source file
gets processed into the target file.

So I need to build the target, then I can parse the target to find
additional targets that I need to also build.

I will have some other mechanisms too, not only Jinja, for building these
files, but each of the targets will need to be parsed after being built.


On Fri, Feb 21, 2020 at 2:11 PM Bill Deegan <bill at baddogconsulting.com>
wrote:

> Scott,
>
> I'm not sure based on your example how all the files which need to be
> processed wouldn't be known before you ran SCons.
>
> if top.F.jinja is the following (and is the top file which ends up
> including all the others)
>
> tgt1.v
> -F pkg1.F
> {% if some_condition %}
> -F pkg2.F
> {% endif %}
>
> And "-F" is the include statement. Then all you'd need is the way to
> evaluate the {% if's %} to know which files it includes.
>
> -Bill
>
> On Thu, Feb 20, 2020 at 10:05 PM Scott Johnson <scott.johnson at arilinc.com>
> wrote:
>
>>
>> On Feb 20, 2020, at 6:46 PM, Bill Deegan <bill at baddogconsulting.com>
>> wrote:
>>
>> Yes. set it as src_scanner.
>>
>> You're scanner doesn't return any nodes...
>>
>>
>> It doesn’t yet, as this is just an experimental toy, but see my original
>> post. I can’t determine what else needs to be built until after the first
>> target is built. And unlike this toy example, the real target isn’t just a
>> simple copy of the source file. So scanning the source file won’t work for
>> me.
>>
>> A traditional scanner looks at the source file and finds dependencies
>> that need to be built before this source file is processed. My use case is
>> different. I need to process the source file, then look at the target file
>> and find new (independent) files to build.
>>
>> I found this question on Stack Overflow that suggests that what I’m
>> trying to do is either tricky or impossible, depending on which answer you
>> believe.
>>
>>
>> https://stackoverflow.com/questions/24671859/scons-how-to-generate-dependencies-after-some-targets-have-been-built/26302284
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20200223/e217e2a7/attachment.html>


More information about the Scons-users mailing list