diff --git a/binding.gyp b/binding.gyp index 70f10f14..8a358ea6 100644 --- a/binding.gyp +++ b/binding.gyp @@ -47,10 +47,6 @@ '-Wno-deprecated-copy' ], 'msvs_settings': { - 'VCCLCompilerTool': { - # PREfast requires too much memory for Github Actions - 'EnablePREfast': 'false' - }, 'VCLinkerTool': { 'AdditionalLibraryDirectories': '<(module_root_dir)/deps/ImageMagick-Windows/VisualMagick/lib' } diff --git a/except.gypi b/except.gypi new file mode 100644 index 00000000..e2fb2c5a --- /dev/null +++ b/except.gypi @@ -0,0 +1,25 @@ +{ + 'defines': [ 'NAPI_CPP_EXCEPTIONS' ], + 'cflags!': [ '-fno-exceptions' ], + 'cflags_cc!': [ '-fno-exceptions' ], + 'conditions': [ + ["OS=='win'", { + "defines": [ + "_HAS_EXCEPTIONS=1" + ], + "msvs_settings": { + "VCCLCompilerTool": { + "ExceptionHandling": 1, + 'EnablePREfast': 'true', + }, + }, + }], + ["OS=='mac'", { + 'xcode_settings': { + 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', + 'CLANG_CXX_LIBRARY': 'libc++', + 'MACOSX_DEPLOYMENT_TARGET': '10.7', + }, + }], + ], +}