[Scons-users] How to make a builder that takes a list of parameters
Bijan Chokoufe Nejad
bijan.chokoufe at gmail.com
Thu Jun 11 09:29:27 EDT 2015
Hi all,
I have a list of files and a list of descriptions that should be
compiled together to a plot. So I need something like
cmd file1:desc1 file2:desc2 ...
In an old post, I saw someone using optional arguments for the generator
like this
def generate_plot(source, target, env, for_signature,
descriptions=None):
target_dir = target[0].dir
if descriptions is not None:
sources = ' '.join([str(s) + ':' + d for (s,d) in
zip(source, descriptions)])
else:
sources = ' '.join([str(s) for s in source])
return plot_cmd + '-o %s %s' % (target_dir, sources)
build_plot = Builder(generator = generate_plot)
But with scons 2.0.1 this doesn't seem to work?! What is the recommended
way for such scenarios? Should I try to use an emitter for this?
Thanks a lot,
Bijan
More information about the Scons-users
mailing list