Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable the cpp exception in the release build #513

Merged
merged 4 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@
'configurations': {
'Debug': {
'defines': ['NAPI_CPP_EXCEPTIONS', 'DEBUG', '_DEBUG'],
'cflags_cc!': [
"-fno-exceptions",
],
"cflags_cc": [
"-fexceptions"
],
'conditions': [
['OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {
'cflags_cc!': [
Expand Down Expand Up @@ -161,7 +167,13 @@

'Release': {
'defines': [
'NAPI_DISABLE_CPP_EXCEPTIONS',
'NAPI_CPP_EXCEPTIONS',
],
'cflags_cc!': [
"-fno-exceptions",
],
"cflags_cc": [
"-fexceptions",
],
'conditions': [
['OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {
Expand Down Expand Up @@ -200,6 +212,7 @@
'RuntimeLibrary': 2,
'AdditionalOptions': [
'-std:c++17',
'/EHsc'
],
},
'VCLinkerTool': {
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@
],
"scripts": {
"install": "node-gyp-build",
"clean": "shx rm -rf build lib libzmq tmp zmq && shx mkdir -p tmp && shx touch tmp/.gitkeep",
"clean": "shx rm -rf build lib libzmq tmp zmq prebuilds && shx mkdir -p tmp && shx touch tmp/.gitkeep",
"build.js": "tsc --project tsconfig-build.json && node script/ci/downlevel-dts.js",
"build.doc": "typedoc --out docs --name zeromq.js --excludeProtected --excludePrivate --excludeNotExported --excludeExternals --externalPattern 'src/+(draft|native|compat).ts' --tsconfig tsconfig-build.json --mode file",
"prebuild": "ts-node -P ./tsconfig.json ./script/prebuild.ts",
"build.native": "prebuildify --napi --build-from-source --debug",
"build.native": "prebuildify --napi --build-from-source",
"build.native.debug": "npm run build.native -- --debug",
"build": "npm run build.js && npm run build.native",
"test": "npm run build.js && mocha",
"build.debug": "npm run build.js && npm run build.native.debug",
"test": "npm run build.debug && mocha",
"lint": "sh script/lint.sh",
"bench": "node --expose-gc test/bench"
},
Expand Down
Empty file removed tmp/.gitkeep
Empty file.