[Scons-users] Code generation in SCons

Bill Deegan bill at baddogconsulting.com
Sat May 2 16:42:35 EDT 2020


Erik,

You should add the generated header files to the targets. Not as
sideeffects.

It's not normal behavior.
Take a look at the yacc builder. It does something similar.

-Bill

On Sat, May 2, 2020 at 1:30 AM Erik Kazandjian <erik.kazandjian at gmail.com>
wrote:

> Sorry to bother you again but there is still something that is not going
> as I joped it would go. Maybe I'm doing something wrong. This is the
> scenario
>
> I have a YANG file that describes datatypes. This YANG file is passed into
> a custom builder (one I wrote) as a single source file and with an empty
> target list. In the emitter step I don't change the  source list but I add
> cpp filenames to the target an also proto filenames. I also add header
> filenames (.hpp) as side effects of the cpp files. So in this stage I'm not
> actually generating the files I just list their names so SCons can figure
> out the dependencies between them. These header files are used somewhere
> else in the project by handcrafted code, so the scanner of that code can
> pick up the header file and therefore the dependency.
>
> Once I have the targets of this builder (.proto and .cpp) files I split
> them up. All the proto files I pass in as sources of a builder that I
> have created and that can deal with protobuffer generation. The cpp files I
> pass as source into a standard library builder.
>
> That all works fine but as said before it takes up to 3 builds before
> SCons decides not to rebuild anything again.
>
> First build : because of the empty variant dir everything the generator
> step of my first builder gets called and all header files cpp files and
> proto files get created physically on disk
>
> The second time I build SCons says that the hpp and cpp file have changed,
> so rebuild
>
> The third time nothing gets rebuild.
>
> I was wondering if this is normal behaviour ?
>
> Regards
> Erik
> _______________________________________________
> 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/20200502/bc92286c/attachment.html>


More information about the Scons-users mailing list