Skip to content

Commit b2f8619

Browse files
authored
test: fixed the way to enable C++ exceptions. (#1061)
PR-URL: #1061 Reviewed-By: Michael Dawson <[email protected]>
1 parent 4a3de56 commit b2f8619

File tree

2 files changed

+41
-22
lines changed

2 files changed

+41
-22
lines changed

except.gypi

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@
22
'defines': [ 'NAPI_CPP_EXCEPTIONS' ],
33
'cflags!': [ '-fno-exceptions' ],
44
'cflags_cc!': [ '-fno-exceptions' ],
5-
'msvs_settings': {
6-
'VCCLCompilerTool': {
7-
'ExceptionHandling': 1,
8-
'EnablePREfast': 'true',
9-
},
10-
},
11-
'xcode_settings': {
12-
'CLANG_CXX_LIBRARY': 'libc++',
13-
'MACOSX_DEPLOYMENT_TARGET': '10.7',
14-
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
15-
},
5+
'conditions': [
6+
["OS=='win'", {
7+
"defines": [
8+
"_HAS_EXCEPTIONS=1"
9+
],
10+
"msvs_settings": {
11+
"VCCLCompilerTool": {
12+
"ExceptionHandling": 1,
13+
'EnablePREfast': 'true',
14+
},
15+
},
16+
}],
17+
["OS=='mac'", {
18+
'xcode_settings': {
19+
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
20+
'CLANG_CXX_LIBRARY': 'libc++',
21+
'MACOSX_DEPLOYMENT_TARGET': '10.7',
22+
},
23+
}],
24+
],
1625
}

noexcept.gypi

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,25 @@
22
'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ],
33
'cflags': [ '-fno-exceptions' ],
44
'cflags_cc': [ '-fno-exceptions' ],
5-
'msvs_settings': {
6-
'VCCLCompilerTool': {
7-
'ExceptionHandling': 0,
8-
'EnablePREfast': 'true',
9-
},
10-
},
11-
'xcode_settings': {
12-
'CLANG_CXX_LIBRARY': 'libc++',
13-
'MACOSX_DEPLOYMENT_TARGET': '10.7',
14-
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
15-
},
5+
'conditions': [
6+
["OS=='win'", {
7+
# _HAS_EXCEPTIONS is already defined and set to 0 in common.gypi
8+
#"defines": [
9+
# "_HAS_EXCEPTIONS=0"
10+
#],
11+
"msvs_settings": {
12+
"VCCLCompilerTool": {
13+
'ExceptionHandling': 0,
14+
'EnablePREfast': 'true',
15+
},
16+
},
17+
}],
18+
["OS=='mac'", {
19+
'xcode_settings': {
20+
'CLANG_CXX_LIBRARY': 'libc++',
21+
'MACOSX_DEPLOYMENT_TARGET': '10.7',
22+
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
23+
},
24+
}],
25+
],
1626
}

0 commit comments

Comments
 (0)