Skip to content

Commit

Permalink
Port to NAPI
Browse files Browse the repository at this point in the history
The "5th pty bug" in #432 fixed also.
  • Loading branch information
kkocdko committed Dec 5, 2023
1 parent d6ce76a commit 5dbe674
Show file tree
Hide file tree
Showing 8 changed files with 582 additions and 592 deletions.
48 changes: 44 additions & 4 deletions binding.gyp
Expand Up @@ -28,8 +28,17 @@
'targets': [
{
'target_name': 'conpty',
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
},
'msvs_settings': {
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
},
'include_dirs' : [
'<!(node -e "require(\'nan\')")'
'<!(node -p "require(\'node-addon-api\').include_dir")'
],
'sources' : [
'src/win/conpty.cc',
Expand All @@ -41,17 +50,35 @@
},
{
'target_name': 'conpty_console_list',
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
},
'msvs_settings': {
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
},
'include_dirs' : [
'<!(node -e "require(\'nan\')")'
'<!(node -p "require(\'node-addon-api\').include_dir")'
],
'sources' : [
'src/win/conpty_console_list.cc'
],
},
{
'target_name': 'pty',
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
},
'msvs_settings': {
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
},
'include_dirs' : [
'<!(node -e "require(\'nan\')")',
'<!(node -p "require(\'node-addon-api\').include_dir")',
'deps/winpty/src/include',
],
# Disabled due to winpty
Expand All @@ -73,8 +100,17 @@
'targets': [
{
'target_name': 'pty',
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
},
'msvs_settings': {
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
},
'include_dirs' : [
'<!(node -e "require(\'nan\')")'
'<!(node -p "require(\'node-addon-api\').include_dir")'
],
'sources': [
'src/unix/pty.cc',
Expand All @@ -93,7 +129,9 @@
]
}],
['OS=="mac"', {
"cflags+": ["-fvisibility=hidden"],
"xcode_settings": {
"GCC_SYMBOLS_PRIVATE_EXTERN": "YES", # -fvisibility=hidden
"MACOSX_DEPLOYMENT_TARGET":"10.7"
}
}]
Expand All @@ -109,7 +147,9 @@
'sources': [
'src/unix/spawn-helper.cc',
],
"cflags+": ["-fvisibility=hidden"],
"xcode_settings": {
"GCC_SYMBOLS_PRIVATE_EXTERN": "YES",
"MACOSX_DEPLOYMENT_TARGET":"10.7"
}
},
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -43,7 +43,8 @@
"prepublishOnly": "npm run build"
},
"dependencies": {
"nan": "^2.17.0"
"node-addon-api": "^7.0.0",
"node-api-headers": "^1.1.0"
},
"devDependencies": {
"@types/mocha": "^7.0.2",
Expand Down

0 comments on commit 5dbe674

Please sign in to comment.