OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
| 6 'variables': { |
| 7 'use_system_libusb%': 0, |
| 8 }, |
6 'targets': [ | 9 'targets': [ |
7 { | 10 { |
8 'target_name': 'libusb', | 11 'target_name': 'libusb', |
9 'type': '<(library)', | |
10 'sources': [ | |
11 'libusb/core.c', | |
12 'libusb/descriptor.c', | |
13 'libusb/io.c', | |
14 'libusb/sync.c', | |
15 ], | |
16 'include_dirs': [ | |
17 '.', | |
18 'libusb', | |
19 'libusb/os', | |
20 ], | |
21 'conditions': [ | 12 'conditions': [ |
22 [ 'OS == "linux"', { | 13 ['OS == "linux" and use_system_libusb', { |
| 14 'type': 'none', |
| 15 'direct_dependent_settings': { |
| 16 'defines': [ |
| 17 'USE_SYSTEM_LIBUSB', |
| 18 ], |
| 19 'cflags': [ |
| 20 '<!@(pkg-config --cflags libusb-1.0)', |
| 21 ], |
| 22 'link_settings': { |
| 23 'ldflags': [ |
| 24 '<!@(pkg-config --libs-only-L --libs-only-other libusb-1.0)', |
| 25 ], |
| 26 'libraries': [ |
| 27 '<!@(pkg-config --libs-only-l libusb-1.0)', |
| 28 ], |
| 29 }, |
| 30 }, |
| 31 }, { |
| 32 'type': '<(library)', |
23 'sources': [ | 33 'sources': [ |
24 'libusb/os/linux_usbfs.c', | 34 'src/libusb/core.c', |
25 'libusb/os/threads_posix.c', | 35 'src/libusb/descriptor.c', |
26 ], | 36 'src/libusb/io.c', |
27 'defines': [ | 37 'src/libusb/sync.c', |
28 'DEFAULT_VISIBILITY=', | |
29 'HAVE_POLL_H=1', | |
30 'HAVE_SYS_TIME_H=1', | |
31 'OS_LINUX=1', | |
32 'POLL_NFDS_TYPE=nfds_t', | |
33 'THREADS_POSIX=1', | |
34 '_GNU_SOURCE=1', | |
35 ], | |
36 }], | |
37 [ 'OS == "win"', { | |
38 'sources': [ | |
39 'libusb/os/poll_windows.c', | |
40 'libusb/os/threads_windows.c', | |
41 'libusb/os/windows_usb.c', | |
42 ], | |
43 'include_dirs!': [ | |
44 '.', | |
45 ], | 38 ], |
46 'include_dirs': [ | 39 'include_dirs': [ |
47 'msvc', | 40 'src', |
| 41 'src/libusb', |
| 42 'src/libusb/os', |
48 ], | 43 ], |
49 }], | 44 'conditions': [ |
50 [ 'OS == "mac"', { | 45 [ 'OS == "linux"', { |
51 'sources': [ | 46 'sources': [ |
52 'libusb/os/darwin_usb.c', | 47 'src/libusb/os/linux_usbfs.c', |
53 'libusb/os/threads_posix.c', | 48 'src/libusb/os/threads_posix.c', |
54 ], | 49 ], |
55 'defines': [ | 50 'defines': [ |
56 'DEFAULT_VISIBILITY=', | 51 'DEFAULT_VISIBILITY=', |
57 'HAVE_POLL_H=1', | 52 'HAVE_POLL_H=1', |
58 'HAVE_SYS_TIME_H=1', | 53 'HAVE_SYS_TIME_H=1', |
59 'OS_DARWIN=1', | 54 'OS_LINUX=1', |
60 'POLL_NFDS_TYPE=nfds_t', | 55 'POLL_NFDS_TYPE=nfds_t', |
61 'THREADS_POSIX=1', | 56 'THREADS_POSIX=1', |
62 '_GNU_SOURCE=1', | 57 '_GNU_SOURCE=1', |
| 58 ], |
| 59 }], |
| 60 ['OS == "win"', { |
| 61 'sources': [ |
| 62 'src/libusb/os/poll_windows.c', |
| 63 'src/libusb/os/threads_windows.c', |
| 64 'src/libusb/os/windows_usb.c', |
| 65 ], |
| 66 'include_dirs!': [ |
| 67 'src', |
| 68 ], |
| 69 'include_dirs': [ |
| 70 'src/msvc', |
| 71 ], |
| 72 }], |
| 73 ['OS == "mac"', { |
| 74 'sources': [ |
| 75 'src/libusb/os/darwin_usb.c', |
| 76 'src/libusb/os/threads_posix.c', |
| 77 ], |
| 78 'defines': [ |
| 79 'DEFAULT_VISIBILITY=', |
| 80 'HAVE_POLL_H=1', |
| 81 'HAVE_SYS_TIME_H=1', |
| 82 'OS_DARWIN=1', |
| 83 'POLL_NFDS_TYPE=nfds_t', |
| 84 'THREADS_POSIX=1', |
| 85 '_GNU_SOURCE=1', |
| 86 ], |
| 87 }], |
63 ], | 88 ], |
64 }], | 89 }], |
65 ], | 90 ], |
66 }, | 91 }, |
67 ], | 92 ], |
68 } | 93 } |
OLD | NEW |