Skip to content

Commit 7a275bf

Browse files
node-pre-gyp version
1 parent d68f710 commit 7a275bf

5 files changed

Lines changed: 367 additions & 23 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ Thumbs.db
22
build/
33
.node_pre_gyprc
44
.vscode/
5+
build-tmp*/
6+
lib/binding/
57

68
# Ignore the downloaded SDK
79
/sdk

binding.gyp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@
1818
}]
1919
],
2020
'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ],
21+
},
22+
{
23+
"target_name": "action_after_build",
24+
"type": "none",
25+
"dependencies": [ "<(module_name)" ],
26+
"copies": [
27+
{
28+
"files": [ "<(PRODUCT_DIR)/<(module_name).node" ],
29+
"destination": "<(module_path)"
30+
}
31+
]
2132
}
2233
]
2334
}

lib/kinect2.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
const kinect = require('bindings')('kinect2'),
2-
{ EventEmitter } = require('events');
1+
const { EventEmitter } = require('events');
2+
3+
const binary = require('@mapbox/node-pre-gyp');
4+
const path = require('path');
5+
const binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json')));
6+
const kinect = require(binding_path);
37

48
class Kinect2 extends EventEmitter {
59
constructor() {

0 commit comments

Comments
 (0)