[Scons-users] Extending a parameter list

Barnaby Jones simba at xn--schrdingerskatze-pwb.de
Tue Oct 21 08:54:30 EDT 2014


CPPDEFINES is  very handy.
Thank you.
On 21.10.2014 14:27, Dirk Bächle wrote:
> Hi,
>
> On 21.10.2014 14:09, Barnaby Jones wrote:
>> I'm using Python 2.7.8 with scons 2.3.5 linux/arch
>>
>> Is it possible to extend a compiler parameter list? Until recently i 
>> thought this would work:
>>
>> cc_flagsShared = Split("""-DHAVE_CONFIG_H
>>                     -std=c11
>>                     -Werror""")
>>
>> and append or extend it with
>>
>> cc_flagsStatic = cc_flagsShared.append('-DMAKE_STATIC')
>> cc_flagsStatic = cc_flagsShared.extend('-DMAKE_STATIC')
>>
>>
>> but in this case cc_flagsStatic is always empty:
>>
> yes, it's well possible...but you have to assign your additional 
> definitions to the correct Environment variables:
>
>   env = Environment()
>   cc_flagsShared = Split("""-DHAVE_CONFIG_H
>                     -std=c11
>                     -Werror""")
>   env['CFLAGS'] = cc_flagsShared
>
> , then extend with:
>
>   env.Append(CFLAGS=['-DMAKE_STATIC'])
>
> Note: For defines it's always better to use the CPPDEFINES variable, 
> because this will give you cross-platform compatibility for free. 
> Checkout the User guide and read some more on how to assign and extend 
> Environment variables!
>
> Best regards,
>
> Dirk
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users



More information about the Scons-users mailing list