Skip to content

Commit

Permalink
doc: fix documentation about how to enable C++ exception (nodejs#1059)
Browse files Browse the repository at this point in the history
* doc: fixed doc about how to enable C++ exceptions.

PR-URL: nodejs#1059
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
NickNaso authored and Deepak Rajamohan committed Sep 23, 2021
1 parent e9cd96a commit 7b573b1
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions doc/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,25 @@ To use **Node-API** in a native module:
```gyp
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
},
'msvs_settings': {
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
},
'conditions': [
["OS=='win'", {
"defines": [
"_HAS_EXCEPTIONS=1"
],
"msvs_settings": {
"VCCLCompilerTool": {
"ExceptionHandling": 1
},
},
}],
["OS=='mac'", {
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
},
}],
],
```

Alternatively, disable use of C++ exceptions in Node-API:
Expand Down

0 comments on commit 7b573b1

Please sign in to comment.