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 'required_libusb_version': '1.0.0', | |
Paweł Hajdan Jr.
2012/05/10 06:36:15
nit: This is not so much needed, because the lates
Garret Kelly
2012/05/10 17:44:01
Done.
| |
9 }, | |
6 'targets': [ | 10 'targets': [ |
7 { | 11 { |
8 'target_name': 'libusb', | 12 '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': [ | 13 'conditions': [ |
22 [ 'OS == "linux"', { | 14 ['OS == "linux" and use_system_libusb', { |
15 'type': 'none', | |
16 'direct_dependent_settings': { | |
17 'defines': [ | |
18 'USE_SYSTEM_LIBUSB', | |
19 ], | |
20 'cflags': [ | |
21 '<!@(pkg-config --atleast-version=<(required_libusb_version) libus b-1.0)', | |
22 '<!@(pkg-config --cflags libusb-1.0)', | |
23 ], | |
24 'link_settings': { | |
25 'ldflags': [ | |
26 '<!@(pkg-config --libs-only-L --libs-only-other libusb-1.0)', | |
27 ], | |
28 'libraries': [ | |
29 '<!@(pkg-config --libs-only-l libusb-1.0)', | |
30 ], | |
31 }, | |
32 }, | |
33 }, { | |
34 'type': '<(library)', | |
23 'sources': [ | 35 'sources': [ |
24 'libusb/os/linux_usbfs.c', | 36 'src/libusb/core.c', |
25 'libusb/os/threads_posix.c', | 37 'src/libusb/descriptor.c', |
26 ], | 38 'src/libusb/io.c', |
27 'defines': [ | 39 '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 ], | 40 ], |
46 'include_dirs': [ | 41 'include_dirs': [ |
47 'msvc', | 42 'src', |
43 'src/libusb', | |
44 'src/libusb/os', | |
48 ], | 45 ], |
49 }], | 46 'conditions': [ |
50 [ 'OS == "mac"', { | 47 [ 'OS == "linux"', { |
51 'sources': [ | 48 'sources': [ |
52 'libusb/os/darwin_usb.c', | 49 'src/libusb/os/linux_usbfs.c', |
53 'libusb/os/threads_posix.c', | 50 'src/libusb/os/threads_posix.c', |
54 ], | 51 ], |
55 'defines': [ | 52 'defines': [ |
56 'DEFAULT_VISIBILITY=', | 53 'DEFAULT_VISIBILITY=', |
57 'HAVE_POLL_H=1', | 54 'HAVE_POLL_H=1', |
58 'HAVE_SYS_TIME_H=1', | 55 'HAVE_SYS_TIME_H=1', |
59 'OS_DARWIN=1', | 56 'OS_LINUX=1', |
60 'POLL_NFDS_TYPE=nfds_t', | 57 'POLL_NFDS_TYPE=nfds_t', |
61 'THREADS_POSIX=1', | 58 'THREADS_POSIX=1', |
62 '_GNU_SOURCE=1', | 59 '_GNU_SOURCE=1', |
60 ], | |
61 }], | |
62 ['OS == "win"', { | |
63 'sources': [ | |
64 'src/libusb/os/poll_windows.c', | |
65 'src/libusb/os/threads_windows.c', | |
66 'src/libusb/os/windows_usb.c', | |
67 ], | |
68 'include_dirs!': [ | |
69 'src', | |
70 ], | |
71 'include_dirs': [ | |
72 'src/msvc', | |
73 ], | |
74 }], | |
75 ['OS == "mac"', { | |
76 'sources': [ | |
77 'src/libusb/os/darwin_usb.c', | |
78 'src/libusb/os/threads_posix.c', | |
79 ], | |
80 'defines': [ | |
81 'DEFAULT_VISIBILITY=', | |
82 'HAVE_POLL_H=1', | |
83 'HAVE_SYS_TIME_H=1', | |
84 'OS_DARWIN=1', | |
85 'POLL_NFDS_TYPE=nfds_t', | |
86 'THREADS_POSIX=1', | |
87 '_GNU_SOURCE=1', | |
88 ], | |
89 }], | |
63 ], | 90 ], |
64 }], | 91 }], |
65 ], | 92 ], |
66 }, | 93 }, |
67 ], | 94 ], |
68 } | 95 } |
OLD | NEW |