diff --git a/doc/setup.md b/doc/setup.md index 5db3452ad..49e039c8f 100644 --- a/doc/setup.md +++ b/doc/setup.md @@ -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: