[Scons-users] Define function in SConsctruct, use in SConscript

Philipp Kraus philipp.kraus at flashpixx.de
Wed Apr 17 10:45:16 EDT 2013


On 2013-04-17 16:15:05 +0200, Elliott Wolin said:


> Hi,

>

> Just started with scons, simple question, I tried various things and

> nothing worked. Also, I know little about Python (to the credit of both

> I was able to develop a moderately sophisticated build system anyway!).

>

> Problem is, I create a function in SConscript:

>

> def modify_environment(env,reqlist) :

> # process dependency lists

> list = reqlist.split()

> for l in list:

> exec("from load" + l + " import load" +l)

> exec("load" + l + "(env)")

> Export('modify_environment')


see also http://www.scons.org/doc/0.96.1/HTML/scons-user/x1826.html

Phil




More information about the Scons-users mailing list