[Scons-users] Code generation in SCons
Erik Kazandjian
erik.kazandjian at gmail.com
Sat May 2 04:29:49 EDT 2020
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20200502/4b04c725/attachment.html>
More information about the Scons-users
mailing list