Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate XCode project on Mac with node-gyp

I'm using the node-gyp to build the node.js add-on. The contents of the binding.gyp file is

{
  'targets': [
    {
      'target_name': 'myapp',
      'include_dirs': ['api-sdk'],
      'sources': [ 'main.cpp', 'lib.cpp'],
      'cflags!': [ '-fno-exceptions' ],
      'cflags_cc!': [ '-fno-exceptions' ],
      'conditions': [
        ['OS=="mac"', {
          'xcode_settings': {
            'GCC_ENABLE_CPP_EXCEPTIONS': 'YES'
          }
        }]
      ]
    }
  ]
}

On Windows, when I run node-gyp configure, the Visual Studio project is generated automatically. But on Mac, it doesn't generate the correspnding XCode project after executing node-gyp configure.

Does anybody know how to generate the XCode project with Node-gyp? Should I add some settings to the binding.gyp file?

Thanks,

Jeffrey

like image 470
Jeffrey Avatar asked Aug 14 '13 05:08

Jeffrey


1 Answers

Just solved it myself after placing the bounty... :)

node-gyp configure -- -f xcode

was the answer to this question.

like image 129
sqreept Avatar answered Nov 04 '22 13:11

sqreept