-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathbinding.gyp
More file actions
executable file
·56 lines (56 loc) · 1.41 KB
/
binding.gyp
File metadata and controls
executable file
·56 lines (56 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
"variables": {
"use_libgpiod%": "false",
"dht_verbose%": "false",
"libgpiod_version": "<!(node -e \"try { var v = require('child_process').execSync('pkg-config --modversion libgpiod', {stdio: 'pipe'}).toString().trim(); console.log(parseInt(v.split('.')[0], 10) >= 2 ? '2' : '1'); } catch(e) { console.log('1'); }\")"
},
"targets": [
{
"target_name": "node_dht_sensor",
"sources": [
"src/bcm2835/bcm2835.c",
"src/dht-sensor.cpp",
"src/node-dht-sensor.cpp",
"src/util.cpp",
"src/abstract-gpio.cpp"
],
"dependencies": [
"<!(node -p \"require('node-addon-api').gyp\")"
],
"defines": [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ],
"include_dirs": [
"<!@(node -p \"require('node-addon-api').include\")"
],
"cflags": [
"-O3",
"-Wno-unused-variable",
"-Wno-unused-function"
],
"conditions": [
[
"dht_verbose=='true'",
{
"defines": [
"VERBOSE"
]
}
],
[
"use_libgpiod=='true'",
{
"defines": [
"USE_LIBGPIOD",
"GPIOD_V<(libgpiod_version)"
],
"libraries": [
"-lgpiod"
],
"sources!": [
"src/bcm2835/bcm2835.c"
]
}
]
]
}
]
}