littlorryatchina / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

XCode generator does not properly handle $(inherited) within defines #257

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a gyp file that has the value $(inherited) in its list of defines
2. Run it through the xcode project file generator
3. Open the project and try to compile things

What is the expected output? What do you see instead?
The $inherited should not mess up the build. Instead, quotes are added around 
it, so that it looks like "$(inherited)", which when $(inherited) is resolved, 
turns into "", and you get a -D "" in the resulting GCC command when trying to 
build.

What version of the product are you using? On what operating system?
Head version, osx lion

Please provide any additional information below.

The problem is with the EscapeXCodeArgument function here: 
http://code.google.com/p/gyp/source/browse/trunk/pylib/gyp/generator/xcode.py#58
2

It's used only for defines, and adds quotes around them always. I'm not sure if 
the correct fix is to just delete the escaping, or to only escape when a space 
appears in the value.

If we do no escaping, then:
defines = [ 'VALUE="asdf thing"' ], 
will work fine since there are quotes added within the setting.
defines = [ 'VALUE=asdf thing' ], 
will not work fine.

Perhaps the best solution is to only escape when there is a space in the value?

Original issue reported on code.google.com by agri...@google.com on 27 Mar 2012 at 8:17

GoogleCodeExporter commented 9 years ago
The simplest solution is to not escape these.

Original comment by kbong...@google.com on 8 Jul 2013 at 9:04

GoogleCodeExporter commented 9 years ago
I fixed this with https://codereview.chromium.org/18305002/ and 
https://codereview.chromium.org/18621003/ i.e. by changing how we escape, 
rather than a special case for $(inherited). Can we mark this as fixed?

Original comment by ho...@google.com on 9 Jul 2013 at 2:19

GoogleCodeExporter commented 9 years ago

Original comment by thakis@chromium.org on 30 Jul 2013 at 5:09