help in simplification of code [string manipulation]

Christophe chris.cavalaria at free.fr
Wed Sep 14 04:55:42 EDT 2005


John a écrit :
> Thanks for your replies...
> Solved my problem.

Even so, I made a big mistake here. The Split function is of no use 
because there is already a list of flags. Better do it like that :
libs = Split('glut GLU GL m')
env.Append (LIBS = libs)

BTW, Split is a scons function.

> Christophe wrote:
> 
>>John a écrit :
>>
>>>How could I simplify the code to get libs out of LDFLAGS
>>>or vice versa automatically in the following python/scons code?
>>>
>>>if sys.platform[:5] == 'linux':
>>>	env.Append (CPPFLAGS = '-D__LINUX')
>>>	env.Append (LDFLAGS  = '-lglut -lGLU -lGL -lm')
>>>	env.Append(CPPPATH=['include', 'include/trackball'])
>>>	libs = ['glut',
>>>		'GLU',
>>>		'GL',
>>>		'm',]
>>>
>>>
>>>Thanks,
>>>--j
>>>
>>
>>Why don't you use the LIBS var in the environment instead of the LDFLAGS
>>? And what use would be the libs var for you ?
>>
>>if sys.platform[:5] == 'linux':
>>	libs = ['glut',
>>		'GLU',
>>		'GL',
>>		'm',]
>>	env.Append (CPPFLAGS = '-D__LINUX')
>>	env.Append (LIBS = Split(libs))
>>	env.Append(CPPPATH=['include', 'include/trackball'])
> 
> 



More information about the Python-list mailing list