File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -39,14 +39,25 @@ To use **Node-API** in a native module:
3939``` gyp
4040 ' cflags!' : [ ' -fno-exceptions' ],
4141 ' cflags_cc!' : [ ' -fno-exceptions' ],
42- ' xcode_settings' : {
43- ' GCC_ENABLE_CPP_EXCEPTIONS' : ' YES' ,
44- ' CLANG_CXX_LIBRARY' : ' libc++' ,
45- ' MACOSX_DEPLOYMENT_TARGET' : ' 10.7' ,
46- },
47- ' msvs_settings' : {
48- ' VCCLCompilerTool' : { ' ExceptionHandling' : 1 },
49- },
42+ ' conditions' : [
43+ [" OS=='win'" , {
44+ " defines" : [
45+ " _HAS_EXCEPTIONS=1"
46+ ],
47+ " msvs_settings" : {
48+ " VCCLCompilerTool" : {
49+ " ExceptionHandling" : 1
50+ },
51+ },
52+ }],
53+ [" OS=='mac'" , {
54+ ' xcode_settings' : {
55+ ' GCC_ENABLE_CPP_EXCEPTIONS' : ' YES' ,
56+ ' CLANG_CXX_LIBRARY' : ' libc++' ,
57+ ' MACOSX_DEPLOYMENT_TARGET' : ' 10.7' ,
58+ },
59+ }],
60+ ],
5061```
5162
5263 Alternatively, disable use of C++ exceptions in Node-API:
You can’t perform that action at this time.
0 commit comments