Skip to content

Instantly share code, notes, and snippets.

@ryancole
Forked from TooTallNate/README.md
Created May 10, 2012 15:29
Show Gist options
  • Save ryancole/2653914 to your computer and use it in GitHub Desktop.
Save ryancole/2653914 to your computer and use it in GitHub Desktop.
'cflags' parameter is broken in gyp on OS X?

This is a barebones GYP file to compile 1 C source file. We are demonstrating that the cflags parameter in gyp files gets completely ignored :(

$ ../gyp/gyp -f make --depth=. hello.gyp
$ V=1 make
  cc   -fasm-blocks -mpascal-strings -Os -gdwarf-2  -MMD -MF out/Default/.deps/out/Default/obj.target/hello/hello.o.d.raw  -c -o out/Default/obj.target/hello/hello.o hello.c
  ./gyp-mac-tool flock out/Default/linker.lock g++ -Lout/Default   -o "out/Default/hello" out/Default/obj.target/hello/hello.o 
  LINK(target) out/Default/hello: Finished

We would expect a -ObjC flag to be present somewhere in the cc command, but it's not...

#include <stdio.h>
int main () {
printf("Hello\n");
return 0;
}
{
'targets': [
{
'target_name': 'hello',
'type': 'executable',
'cflags': [
'-ObjC'
],
'sources': [
'hello.c'
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment