forked from node-usb/node-usb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libusb.gypi
131 lines (131 loc) · 3.52 KB
/
libusb.gypi
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{
'variables': {
'use_udev%': 1,
},
'targets': [
{
# Based on https://chromium.googlesource.com/chromium/src/+/master/third_party/libusb/libusb.gyp
'target_name': 'libusb',
'type': 'static_library',
'sources': [
'libusb_config/config.h',
'libusb/libusb/core.c',
'libusb/libusb/descriptor.c',
'libusb/libusb/hotplug.c',
'libusb/libusb/hotplug.h',
'libusb/libusb/io.c',
'libusb/libusb/libusb.h',
'libusb/libusb/libusbi.h',
'libusb/libusb/strerror.c',
'libusb/libusb/sync.c',
'libusb/libusb/version.h',
'libusb/libusb/version_nano.h',
],
'include_dirs': [
'libusb_config',
'libusb/libusb',
'libusb/libusb/os',
],
'direct_dependent_settings': {
'include_dirs': [
'libusb/libusb',
],
},
'defines': [
'ENABLE_LOGGING=1',
],
'cflags': [
'-w',
],
'conditions': [
[ 'OS == "linux" or OS == "android" or OS == "mac"', {
'sources': [
'libusb/libusb/os/poll_posix.c',
'libusb/libusb/os/poll_posix.h',
'libusb/libusb/os/threads_posix.c',
'libusb/libusb/os/threads_posix.h',
],
'defines': [
'DEFAULT_VISIBILITY=',
'HAVE_GETTIMEOFDAY=1',
'HAVE_POLL_H=1',
'HAVE_SYS_TIME_H=1',
'LIBUSB_DESCRIBE="1.0.17"',
'POLL_NFDS_TYPE=nfds_t',
'THREADS_POSIX=1',
],
}],
[ 'OS == "linux" or OS == "android"', {
'sources': [
'libusb/libusb/os/linux_usbfs.c',
'libusb/libusb/os/linux_usbfs.h',
],
'defines': [
'OS_LINUX=1',
'_GNU_SOURCE=1',
'USBI_TIMERFD_AVAILABLE=1',
],
}],
[ 'OS == "linux" and use_udev == 1 or OS == "android"', {
'sources': [
'libusb/libusb/os/linux_udev.c',
],
'defines': [
'HAVE_LIBUDEV=1',
'USE_UDEV=1',
],
'direct_dependent_settings': {
'libraries': [
'-ludev',
]
}
}],
[ 'OS == "linux" and use_udev == 0', {
'sources': [
'libusb/libusb/os/linux_netlink.c',
],
'defines': [
'HAVE_LINUX_NETLINK_H',
],
'conditions': [
['clang==1', {
'cflags': [
'-Wno-pointer-sign',
]
}]
],
}],
[ 'OS == "mac"', {
'sources': [
'libusb/libusb/os/darwin_usb.c',
'libusb/libusb/os/darwin_usb.h',
],
'defines': [
'OS_DARWIN=1',
],
}],
[ 'OS == "win"', {
'sources': [
'libusb/libusb/os/poll_windows.c',
'libusb/libusb/os/poll_windows.h',
'libusb/libusb/os/threads_windows.c',
'libusb/libusb/os/threads_windows.h',
'libusb/libusb/os/windows_common.h',
'libusb/libusb/os/windows_usb.c',
'libusb/libusb/os/windows_usb.h',
'libusb/msvc/config.h',
'libusb/msvc/inttypes.h',
'libusb/msvc/stdint.h',
],
'include_dirs!': [
'libusb_config',
],
'include_dirs': [
'libusb/msvc',
],
'msvs_disabled_warnings': [ 4267 ],
}],
],
},
]
}