rick147 / gyp

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

Can't exclude compile flags that fall under CFLAGS_CC_Release #351

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start with my binding.gyp file:
{
    'targets': [
    {
        'target_name': 'foo',
        'type': '<(library)',
        'sources': [
          'bar.cc',
          'baz.cc',
        ],
        'conditions': [
            ['OS=="linux"', {
                'cflags!': [ '-fno-exceptions', '-fno-rtti'],
                'cflags': ['-fexceptions'],
            }]
        ]
    }]
}

2. node-gyp rebuild --verbose
3. Observe the call to g++

What is the expected output? What do you see instead?
I expect that the build will attempt to run g++ without the fno-exceptions and 
-fno-rtti flags. Instead, it leaves them in.

If you look inside foo.target.mk, you can see that flags under 
CFLAGS_CC_Release refuse to be excluded. The exclude mechanism does not work 
with them. However, it works fine for items under CFLAGS_Release (such as 
-Wall).

What version of the product are you using? On what operating system?
$node-gyp -v
v0.10.0

Ubuntu 13.04

Original issue reported on code.google.com by dkilleb...@dnanexus.com on 19 Jun 2013 at 1:09

GoogleCodeExporter commented 9 years ago
I figured out that I have to use "cflags_cc!". It would be nice if the 
documentation mention "cflags_c" and "cflags_cc" to avoid this confusion in the 
future.

Original comment by dkilleb...@dnanexus.com on 19 Jun 2013 at 4:41