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

我正在使用node-gyp来构buildnode.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' } }] ] } ] } 

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

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

谢谢,

杰弗里

刚刚解决它后,放置赏金… 🙂

node-gyp configure -- -f xcode

是这个问题的答案。