Update mojo sdk to rev 1dc8a9a5db73d3718d99917fadf31f5fb2ebad4f
[chromium-blink-merge.git] / third_party / libusb / libusb.gyp
blob21ce2434d1238dbe4f81a91fa3e1a4b40b2c8cee
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6   'targets': [
7     {
8       'target_name': 'libusb',
9       'type': 'static_library',
10       'sources': [
11         'src/config.h',
12         'src/libusb/core.c',
13         'src/libusb/descriptor.c',
14         'src/libusb/hotplug.c',
15         'src/libusb/hotplug.h',
16         'src/libusb/interrupt.c',
17         'src/libusb/interrupt.h',
18         'src/libusb/io.c',
19         'src/libusb/libusb.h',
20         'src/libusb/libusbi.h',
21         'src/libusb/strerror.c',
22         'src/libusb/sync.c',
23         'src/libusb/version.h',
24         'src/libusb/version_nano.h',
25       ],
26       'include_dirs': [
27         'src',
28         'src/libusb',
29         'src/libusb/os',
30       ],
31       'direct_dependent_settings': {
32         'include_dirs': [
33           'src/libusb',
34         ],
35       },
36       'conditions': [
37         ['OS=="linux" or OS=="mac"', {
38           'sources': [
39             'src/libusb/os/poll_posix.c',
40             'src/libusb/os/poll_posix.h',
41             'src/libusb/os/threads_posix.c',
42             'src/libusb/os/threads_posix.h',
43           ],
44           'defines': [
45             'DEFAULT_VISIBILITY=',
46             'HAVE_GETTIMEOFDAY=1',
47             'HAVE_POLL_H=1',
48             'HAVE_SYS_TIME_H=1',
49             'LIBUSB_DESCRIBE="1.0.16"',
50             'POLL_NFDS_TYPE=nfds_t',
51             'THREADS_POSIX=1',
52           ],
53         }],
54         ['OS=="linux"', {
55           'sources': [
56             'src/libusb/os/linux_usbfs.c',
57             'src/libusb/os/linux_usbfs.h',
58           ],
59           'defines': [
60             'OS_LINUX=1',
61             '_GNU_SOURCE=1',
62           ],
63         }],
64         ['use_udev==1', {
65           'sources': [
66             'src/libusb/os/linux_udev.cc',
67           ],
68           'defines': [
69             'HAVE_LIBUDEV=1',
70             'USE_UDEV=1',
71           ],
72           'dependencies': [
73             '../../device/udev_linux/udev.gyp:udev_linux',
74           ],
75           'include_dirs': [
76             '../..',
77           ],
78         }],
79         ['OS=="linux" and use_udev==0', {
80           'sources': [
81             'src/libusb/os/linux_netlink.c',
82           ],
83           'defines': [
84             'HAVE_LINUX_NETLINK_H',
85           ],
86           'conditions': [
87             ['clang==1', {
88               'cflags': [
89                 '-Wno-pointer-sign',
90               ]
91             }]
92           ],
93         }],
94         ['OS=="mac"', {
95           'sources': [
96             'src/libusb/os/darwin_usb.c',
97             'src/libusb/os/darwin_usb.h',
98           ],
99           'defines': [
100             'OS_DARWIN=1',
101           ],
102         }],
103         ['OS=="win"', {
104           'sources': [
105             'src/libusb/os/poll_windows.c',
106             'src/libusb/os/poll_windows.h',
107             'src/libusb/os/threads_windows.c',
108             'src/libusb/os/threads_windows.h',
109             'src/libusb/os/windows_common.h',
110             'src/libusb/os/windows_usb.c',
111             'src/libusb/os/windows_usb.h',
112             'src/msvc/config.h',
113             'src/msvc/inttypes.h',
114             'src/msvc/stdint.h',
115           ],
116           'include_dirs!': [
117             'src',
118           ],
119           'include_dirs': [
120             'src/msvc',
121           ],
122           'msvs_disabled_warnings': [ 4267 ],
123         }],
124       ],
125     },
126   ],