-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbinding.gyp
63 lines (56 loc) · 1.84 KB
/
binding.gyp
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
57
58
59
60
61
62
{
# Shared configuration
"target_defaults": {
"default_configuration": "Release",
"cflags": [ "-std=c++0x", "-W", "-Wall", "-pipe" ],
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
"include_dirs": [ "include", "/usr/local/include" ],
"libraries": [ "-L/usr/local/lib" ],
"configurations": {
"Debug" : {
"defines": [ "DEBUG" ],
"cflags": [ "-g" ]
},
"Release" : {
"defines": [ "RELEASE" ],
"cflags": [ "-O2" ]
}
}
},
"variables" : {
"gpio" : "true",
"wiringPi-lib" : "-lwiringPi", # wiringPi static lib, ignore if not used
"i2c-bus-file" : "/dev/i2c-1" # i2c file to use for i2c sensors
},
"targets": [
{
"target_name": "raspi-sensors",
"sources": [
"src/format.cc",
"src/wrapper_sensor.cc",
"src/plugin.cc",
"src/sensor.cc",
"src/sensor_result.cc",
"src/i2c_sensor.cc",
"src/TSL2561.cc",
"src/BMP180.cc"
],
"defines": [ "I2C_BUS_FILE=\"<(i2c-bus-file)\"" ],
'conditions': [
[ # raspi-sensor with GPIO activated (note that GPIO requires wiringPi)
'gpio == "true"', {
"sources": [
"src/gpio_sensor.cc",
"src/DHT22.cc",
"src/DHT11.cc",
"src/PIR.cc"
],
"defines": [ "USE_GPIO" ],
"libraries": [ "<(wiringPi-lib)" ]
}
]
]
}
]
}