[Scons-users] Using multiple scanners together

Brian Cody brian.j.cody at gmail.com
Thu Mar 19 16:13:17 EDT 2015


I have rediscovered an issue that I hacked around previously. I have a
project file I want to scan. This scan will produce a list of files with a
different extension. I then want to scan these files as well. The problem
is that I can't make SCons respect skeys when recursing. For example:

env['SCANNERS'].append(SCons.Scanner.Scanner(scanners.scan_vhdl_file,
path_function=SCons.Script.FindPathDirs('VHD_PATH'), recursive=True,
skeys=['.vhd']))
env['SCANNERS'].append(SCons.Scanner.Scanner(scanners.scan_prj_file,
path_function=SCons.Script.FindPathDirs('VHD_PATH'), recursive=True,
skeys=['.prj']))

This is the code I would expect to have to write. In this case, the project
file is scanned and the vhd files within are detected. It then opens the
vhd files using the project file scanner rather than the vhd file scanner.
Fine--I suppose recursive could be interpreted that way--but disabling
recursive doesn't help either. What ends up happening is that SCons doesn't
scan the vhd files at all, which I take as a different interpretation of
what recursive means. If the vhd files are given as the original source,
everything works fine.

My hack is a hybrid scanner function that detects whether the file being
scanned in a project file or a vhd file, and it redirects to the proper
scanning function.

Is there a more correct way to accomplish this?

Thanks!
-Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150319/672adc51/attachment-0001.html>


More information about the Scons-users mailing list