Skip to content

Commit

Permalink
test: fixed the way to enable C++ exceptions. (nodejs#1061)
Browse files Browse the repository at this point in the history
PR-URL: nodejs#1061
Reviewed-By: Michael Dawson <midawson@redhat.com>
  • Loading branch information
NickNaso authored and Deepak Rajamohan committed Sep 23, 2021
1 parent ecd9eef commit e9cd96a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 22 deletions.
31 changes: 20 additions & 11 deletions except.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@
'defines': [ 'NAPI_CPP_EXCEPTIONS' ],
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'msvs_settings': {
'VCCLCompilerTool': {
'ExceptionHandling': 1,
'EnablePREfast': 'true',
},
},
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
},
'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',
},
}],
],
}
32 changes: 21 additions & 11 deletions noexcept.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@
'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ],
'cflags': [ '-fno-exceptions' ],
'cflags_cc': [ '-fno-exceptions' ],
'msvs_settings': {
'VCCLCompilerTool': {
'ExceptionHandling': 0,
'EnablePREfast': 'true',
},
},
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
},
'conditions': [
["OS=='win'", {
# _HAS_EXCEPTIONS is already defined and set to 0 in common.gypi
#"defines": [
# "_HAS_EXCEPTIONS=0"
#],
"msvs_settings": {
"VCCLCompilerTool": {
'ExceptionHandling': 0,
'EnablePREfast': 'true',
},
},
}],
["OS=='mac'", {
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
},
}],
],
}

0 comments on commit e9cd96a

Please sign in to comment.