如何使用node-gyp在Mac上生成XCode项目

Jef*_*rey 9 macos xcode node.js node-gyp

我正在使用node-gyp来构建node.js附加组件.binding.gyp文件的内容是

{
  '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'
          }
        }]
      ]
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

在Windows上,当我运行时node-gyp configure,Visual Studio项目会自动生成.但在Mac上,它在执行后不会生成相应的XCode项目node-gyp configure.

有人知道如何使用Node-gyp生成XCode项目吗?我应该在binding.gyp文件中添加一些设置吗?

谢谢,

杰弗里

sqr*_*ept 12

放下赏金后,我自己解决了...... :)

node-gyp configure -- -f xcode

是这个问题的答案.