If you're using Depends()
you're probably doing something wrong...
(this usually means you're not specifying a target or a source, or the scanner for your builder(s) are missing files)
SCons' builders define scanners which scan the source code looking for included files and save that info.
Additionally you specify to all builders the sources for the targets they build.
Generally files are already only re-scanned if they change.
There are some command line flags to SCons which can impact the scanning of source files (From the manpage: https://scons.org/doc/production/HTML/scons-man.html )
--implicit-cache
Cache implicit dependencies. This causes scons to use the implicit (scanned) dependencies from the last time it was run instead of scanning the files for implicit dependencies. This can significantly speed up SCons, but with the following limitations:
scons will not detect changes to implicit dependency search paths (e.g. CPPPATH, LIBPATH) that would ordinarily cause different versions of same-named files to be used.
scons will miss changes in the implicit dependencies in cases where a new implicit dependency is added earlier in the implicit dependency search path (e.g. CPPPATH, LIBPATH) than a current implicit dependency with the same name.
--implicit-deps-changed
Forces SCons to ignore the cached implicit dependencies. This causes the implicit dependencies to be rescanned and recached. This implies --implicit-cache.
--implicit-deps-unchanged
Force SCons to ignore changes in the implicit dependencies. This causes cached implicit dependencies to always be used. This implies --implicit-cache.
Or did you mean something else?