[Scons-dev] Where does scons determine the dependencies for object files?

Andrew C. Morrow andrew.c.morrow at gmail.com
Sun Mar 25 13:07:43 EDT 2018


I'm fairly clear on where SCons learns of the dependencies for source
files: that is in the CScanner attached to the SourceFileScanner in T
ool/__init__.py.

But where does SCons determine the dependencies of object files, such that
those dependencies are checked to see if the object file needs to be
rebuilt?

More concretely, If I have libfoo.so made from foo.o made from foo.c which
depends on foo.h, the CScanner in SourceScanner takes care of scanning for
dependences in foo.c and finds foo.h. But what scans for dependences of
foo.o and identifies foo.c?

I ask because I would like to sometimes inject a new source-like dependency
into compilations, such that foo.o will depend on not just foo.c but also
some other file magic, such that if magic is changed then foo.o will need
to be rebuilt.

With such a mechanism, it would be possible to teach SCons that if an
AddressSanitizer blacklist file known to be on the compile line like
-fsanitize-blacklist=path/to/magic is referring to a blacklist file that is
more up to date than the object file, then the object file should be
rebuilt.

Thanks,
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/scons-dev/attachments/20180325/2032545d/attachment.html>


More information about the Scons-dev mailing list