Skip to content

Commit

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

PR-URL: #1059
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
NickNaso authored Sep 3, 2021
1 parent b2f8619 commit 9aaf3b1
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 9aaf3b1

Please sign in to comment.