From 28ed3397c00bdd32833b50f8560c30ab4cac6ad7 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 15 Sep 2023 00:12:02 +0200 Subject: [PATCH] copy except.gypi from node-addon-api (#15) until a solution for https://github.com/nodejs/node-addon-api/issues/1379 is found --- binding.gyp | 4 ---- except.gypi | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 except.gypi 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', + }, + }], + ], +}