Skip to content

Commit

Permalink
Try sharing build settings
Browse files Browse the repository at this point in the history
  • Loading branch information
niik committed Jun 3, 2024
1 parent f7b91a1 commit 033d4d6
Showing 1 changed file with 12 additions and 50 deletions.
62 changes: 12 additions & 50 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{
'targets': [
{
'target_name': 'desktop-trampoline',
'target_defaults': {
'defines': [
"NAPI_VERSION=<(napi_build_version)",
],
'type': 'executable',
'sources': [
'src/desktop-trampoline.c',
'src/socket.c'
],
'include_dirs': [
'<!(node -p "require(\'node-addon-api\').include_dir")',
'include'
Expand Down Expand Up @@ -42,9 +36,19 @@
'msvs_settings': {
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
},
'conditions': [
['OS=="win"', { 'defines': [ 'WINDOWS' ] }]
]
},
'targets': [
{
'target_name': 'desktop-trampoline',
'sources': [
'src/desktop-trampoline.c',
'src/socket.c'
],
'conditions': [
['OS=="win"', {
'defines': [ 'WINDOWS' ],
'link_settings': {
'libraries': [ 'Ws2_32.lib' ]
}
Expand All @@ -53,51 +57,9 @@
},
{
'target_name': 'ssh-wrapper',
'defines': [
"NAPI_VERSION=<(napi_build_version)",
],
'type': 'executable',
'sources': [
'src/ssh-wrapper.c'
],
'include_dirs': [
'<!(node -p "require(\'node-addon-api\').include_dir")',
'include'
],
'xcode_settings': {
'OTHER_CFLAGS': [
'-Wall',
'-Werror',
'-Werror=format-security',
'-fPIC',
'-D_FORTIFY_SOURCE=1',
'-fstack-protector-strong'
]
},
'cflags!': [
'-Wall',
'-Werror',
'-fPIC',
'-pie',
'-D_FORTIFY_SOURCE=1',
'-fstack-protector-strong',
'-Werror=format-security',
'-fno-exceptions'
],
'cflags_cc!': [ '-fno-exceptions' ],
'ldflags!': [
'-z relro',
'-z now'
],
'msvs_settings': {
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
},
'conditions': [
# For now only build it for macOS, since it's not needed on Windows
['OS=="win"', {
'defines': [ 'WINDOWS' ],
}]
]
},
],
}

0 comments on commit 033d4d6

Please sign in to comment.