tsekityam / gyp

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

Make backend doesn't escape pound symbols in CFLAGS/etc. #445

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create a gyp file that contains a 'cflags' variable that has a flag with a 
pound symbol in it (e.g. 
https://src.chromium.org/viewvc/chrome/trunk/src/third_party/opus/opus.gyp?revis
ion=281729, which has '-Wno-#pragma-messages'.)
2. Run gyp as normal.

What is the expected output? What do you see instead?

The generated Makefile should escape the pound character, i.e.:

CFLAGS := \
  ...
  -Wno-\#pragma-messages \
  ...

Instead, the pound character is not escaped, and the make will fail due to an 
unknown '-Wno-' flag (and you'll lose a bunch of flags...):

CFLAGS := \
  ...
  -Wno-#pragma-messages \
  ...

What version of the product are you using? On what operating system?

The version in use in Chromium ToT (with a patch to allow Make generator), on 
Linux

Please provide any additional information below.

This likely effects LIBS, includes, etc as well, so we patched it fairly 
globally - though we're no gyp experts so the patch may have side-effects that 
we don't know about :).

I've attached the patch we used; we're happy to take it through a code review 
if gyp is interested in having it.

Original issue reported on code.google.com by smcgr...@google.com on 20 Aug 2014 at 4:29

Attachments: