forked from beyondscreen/node-rpi-ws281x-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
binding.gyp
53 lines (50 loc) · 1.46 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
{
'conditions': [
# FIXME: check for architecture instead of OS, should only build on linux/arm/BCM2702
['OS=="linux"', {
'targets': [
{
'target_name': 'rpi_ws281x',
'sources': ['./src/rpi-ws281x.cc'],
'dependencies': ['rpi_libws2811'],
'include_dirs': ['<!(node -e "require(\'nan\')")']
},
{
'target_name': 'rpi_libws2811',
'type': 'static_library',
'sources': [
'./src/rpi_ws281x/ws2811.c',
'./src/rpi_ws281x/pwm.c',
'./src/rpi_ws281x/dma.c',
'./src/rpi_ws281x/mailbox.c',
'./src/rpi_ws281x/board_info.c'
],
'cflags': ['-O2', '-Wall']
},
{
'target_name':'action_after_build',
'type': 'none',
'dependencies': ['rpi_ws281x'],
'copies': [{
'destination': './lib/binding/',
'files': [
'<(PRODUCT_DIR)/rpi_ws281x.node'
]
}]
}
]
}, { # OS != linux
'targets': [{
# provide a dummy-target that at least won't break the build here
'target_name': 'rpi_ws281x',
'actions': [{
'action_name': 'not_supported_msg',
'inputs': [],
'outputs': [ '--nothing-being-built--' ],
'action': ['true'],
'message': '**** YOU ARE INSTALLING THIS MODULE ON AN UNSUPPORTED PLATFORM ****'
}]
}]
}]
]
}