diff --git a/doc/setup.md b/doc/setup.md index 36e6fc956..3135bf1d3 100644 --- a/doc/setup.md +++ b/doc/setup.md @@ -55,8 +55,19 @@ To use **N-API** in a native module: ```gyp 'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ], ``` - - 4. Include `napi.h` in the native module code. + 4. If you would like your native addon to support OSX, please also add the + following settings in the `binding.gyp` file: + + ```gyp + ['OS=="mac"', { + 'cflags+': ['-fvisibility=hidden'], + 'xcode_settings': { + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden + } + }] + ``` + + 5. Include `napi.h` in the native module code. To ensure only ABI-stable APIs are used, DO NOT include `node.h`, `nan.h`, or `v8.h`.