Персональные инструменты
 

SconsDynamicallyAddTargetToExecutor — различия между версиями

Материал из CustisWiki

Перейти к: навигация, поиск
м
м
Строка 8: Строка 8:
 
  Generated2->MainFile
 
  Generated2->MainFile
 
  Generated3->MainFile
 
  Generated3->MainFile
+
 
 +
  Generated1 [style=filled fillcolor=yellow]
 +
  Generated2 [style=filled fillcolor=yellow]
 +
  Generated3 [style=filled fillcolor=yellow]
 +
 
 
  edge [color=blue style=solid label=generated]
 
  edge [color=blue style=solid label=generated]
 
  Generator->Generated1
 
  Generator->Generated1

Версия 14:54, 9 октября 2009

[svg]


Consider the following situation.

  • MainFile includes some GeneratedNN files (count of these files is unknown)
  • All these GeneratedNN files (+some other files) generated by one Generator file (for example, python script).
  • All included GeneratedNN files needed to be rescanned after generation (they can include other files).

I scan MainFile, and then I see inclusion of Generated1 file, I add something like this:

    cmd=env.Command(Generated1, Generator, RunMePlease)

But actually I need

    cmd=env.Command([Generated1,Generated2,…,GeneratedN], Generator, RunMePlease) 

but I must add targets incrementally during MainFile scan…

Question.svg So the question is: How to dynamically add targets to Command? I try something like

Generator.executor.targets.append(env.fs.Entry(GeneratedN))

but it seems not working…