Skip to content

Commit

Permalink
Fixing Builds
Browse files Browse the repository at this point in the history
  • Loading branch information
stoprocent committed Oct 20, 2023
1 parent 44d5dcc commit 0dd213d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 26 deletions.
34 changes: 23 additions & 11 deletions lib/mac/binding.gyp
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
{
'variables': {
'openssl_fips' : ''
},
'targets': [
{
'target_name': 'binding',
'sources': [ 'src/noble_mac.mm', 'src/napi_objc.mm', 'src/ble_manager.mm', 'src/objc_cpp.mm', 'src/callbacks.cc' ],
'include_dirs': ["<!@(node -p \"require('node-addon-api').include\")"],
'dependencies': ["<!(node -p \"require('node-addon-api').gyp\")"],
'sources': [
'src/noble_mac.mm',
'src/napi_objc.mm',
'src/ble_manager.mm',
'src/objc_cpp.mm',
'src/callbacks.cc'
],
'include_dirs': [
"<!(node -p \"require('node-addon-api').include_dir\")"
],
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
"defines": ["NAPI_CPP_EXCEPTIONS"],
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'MACOSX_DEPLOYMENT_TARGET': '10.9',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'OTHER_CFLAGS': [
'-fobjc-arc',
'-fobjc-arc',
'-arch x86_64',
'-arch arm64'
],
},
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/CoreBluetooth.framework',
'OTHER_LDFLAGS': [
'-framework CoreBluetooth',
'-arch x86_64',
'-arch arm64'
]
},
'product_dir': '../lib/mac/native',
}
}
]
}
30 changes: 25 additions & 5 deletions lib/win/binding.gyp
Original file line number Diff line number Diff line change
@@ -1,22 +1,42 @@
{
'variables': {
'openssl_fips' : ''
},
'targets': [
{
'target_name': 'binding',
'sources': [ 'src/noble_winrt.cc', 'src/napi_winrt.cc', 'src/peripheral_winrt.cc', 'src/radio_watcher.cc', 'src/notify_map.cc', 'src/ble_manager.cc', 'src/winrt_cpp.cc', 'src/winrt_guid.cc', 'src/callbacks.cc' ],
'include_dirs': ["<!@(node -p \"require('node-addon-api').include\")", "<!@(node -p \"require('napi-thread-safe-callback').include\")"],
'dependencies': ["<!(node -p \"require('node-addon-api').gyp\")"],
'sources': [
'src/noble_winrt.cc',
'src/napi_winrt.cc',
'src/peripheral_winrt.cc',
'src/radio_watcher.cc',
'src/notify_map.cc',
'src/ble_manager.cc',
'src/winrt_cpp.cc',
'src/winrt_guid.cc',
'src/callbacks.cc'
],
'include_dirs': [
"<!(node -p \"require('node-addon-api').include_dir\")",
"<!@(node -p \"require('napi-thread-safe-callback').include\")"
],
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'msvs_settings': {
'VCCLCompilerTool': {
'ExceptionHandling': 1,
'AdditionalOptions': ['/await', '/std:c++latest'],
'AdditionalOptions': [
'/await',
'/std:c++latest'
],
},
},
'msvs_target_platform_version':'10.0.18362.0',
'msvs_target_platform_minversion':'10.0.18362.0',
'conditions': [
['OS=="win"', { 'defines': [ '_HAS_EXCEPTIONS=1' ] }]
['OS=="win"', {
'defines': [ '_HAS_EXCEPTIONS=1' ]
}]
],
}
]
Expand Down
15 changes: 5 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"author": "Sandeep Mistry",
"maintainers": [
"Jacob Rosenthal",
"Luis Montes"
"Luis Montes",
"Marek Serafin"
],
"license": "MIT",
"name": "@stoprocent/noble",
Expand All @@ -28,17 +29,11 @@
"engines": {
"node": ">=6"
},
"os": [
"darwin",
"linux",
"freebsd",
"win32"
],
"dependencies": {
"debug": "^4.3.4",
"napi-thread-safe-callback": "^0.0.6",
"node-addon-api": "^7.0.0",
"node-gyp-build": "^4.6.0"
"node-addon-api": "^4.3.0",
"node-gyp-build": "^4.5.0"
},
"optionalDependencies": {
"@stoprocent/bluetooth-hci-socket": "^0.6.4"
Expand Down Expand Up @@ -69,7 +64,7 @@
"install": "node-gyp-build",
"lint": "eslint \"**/*.js\"",
"lint-fix": "eslint \"**/*.js\" --fix",
"prebuildify": "prebuildify --napi --force --strip --verbose",
"prebuildify": "prebuildify --napi --target 14.0.0 --force --strip --verbose",
"prebuildify-cross": "prebuildify-cross --napi --target 14.0.0 --force --strip --verbose",
"semantic-release": "semantic-release",
"pretest": "npm run rebuild",
Expand Down

0 comments on commit 0dd213d

Please sign in to comment.