Skip to content

Commit

Permalink
Document adding -fvisibility=hidden flag for macOS users
Browse files Browse the repository at this point in the history
* -fvisibility=hidden flag for macOS user

Added section to remember the macOS user to add the `-fvisibility=hidden` flag.

PR-URL: #460
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
NickNaso authored and mhdawson committed Apr 2, 2019
1 parent 1ed7ad8 commit 83b41c2
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions doc/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down

0 comments on commit 83b41c2

Please sign in to comment.