[Scons-users] problem with white space in C -D options

Gary Oberbrunner garyo at oberbrunner.com
Mon Jun 1 13:49:24 EDT 2015


On Mon, Jun 1, 2015 at 12:07 PM, Tom Tanner (BLOOMBERG/ LONDON) <
ttanner2 at bloomberg.net> wrote:

> It's equivalent to passing -DABC="some text". It works fine like that, but
> it isn't what I'm trying to do


So it's not about whitespace (which is what I thought from your subject
line) but instead about including quotes or other shell metachars in the
value part of CPPDEFINES?  Basically SCons will shell-quote the string with
double-quotes if needed, but won't do anything more.  So your solution of
including the escaped quote chars is correct: env['CPPDEFINES'] = [ (
'ABC', '\"some stuff\"' ) ]
On Linux (really anything but Windows) you could also do: env['CPPDEFINES']
= [ ( 'ABC', "'some stuff'" ) ]

And you're right that the shell-quoting logic could use some clarification
and cleanup some day.

-- 
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150601/061763fd/attachment-0001.html>


More information about the Scons-users mailing list