Android: Add 7 second GPU channel creation timeout
[chromium-blink-merge.git] / third_party / libusb / BUILD.gn
blob91409b823e42497cefb412b8dd8044dc36326072
1 # Copyright 2014 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.
5 assert(!is_android && !is_ios)
7 config("libusb_config") {
8   include_dirs = [ "src/libusb" ]
11 static_library("libusb") {
12   sources = [
13     "src/config.h",
14     "src/libusb/core.c",
15     "src/libusb/descriptor.c",
16     "src/libusb/hotplug.c",
17     "src/libusb/hotplug.h",
18     "src/libusb/interrupt.c",
19     "src/libusb/interrupt.h",
20     "src/libusb/io.c",
21     "src/libusb/libusb.h",
22     "src/libusb/libusbi.h",
23     "src/libusb/os/darwin_usb.c",
24     "src/libusb/os/darwin_usb.h",
25     "src/libusb/os/linux_udev.cc",
26     "src/libusb/os/linux_usbfs.c",
27     "src/libusb/os/linux_usbfs.h",
28     "src/libusb/os/poll_posix.c",
29     "src/libusb/os/poll_posix.h",
30     "src/libusb/os/poll_windows.c",
31     "src/libusb/os/poll_windows.h",
32     "src/libusb/os/threads_posix.c",
33     "src/libusb/os/threads_posix.h",
34     "src/libusb/os/threads_windows.c",
35     "src/libusb/os/threads_windows.h",
36     "src/libusb/os/windows_common.h",
37     "src/libusb/os/windows_usb.c",
38     "src/libusb/os/windows_usb.h",
39     "src/libusb/strerror.c",
40     "src/libusb/sync.c",
41     "src/libusb/version.h",
42     "src/libusb/version_nano.h",
43     "src/msvc/config.h",
44     "src/msvc/inttypes.h",
45     "src/msvc/stdint.h",
46   ]
47   deps = []
48   include_dirs = [ "src/libusb/os" ]
50   configs -= [ "//build/config/compiler:chromium_code" ]
51   configs += [ "//build/config/compiler:no_chromium_code" ]
53   public_configs = [ ":libusb_config" ]
55   if (is_posix) {
56     defines = [
57       "DEFAULT_VISIBILITY=",
58       "HAVE_GETTIMEOFDAY=1",
59       "HAVE_POLL_H=1",
60       "HAVE_SYS_TIME_H=1",
61       "LIBUSB_DESCRIBE=\"1.0.16\"",
62       "POLL_NFDS_TYPE=nfds_t",
63       "THREADS_POSIX=1",
64     ]
65   }
67   if (is_mac) {
68     defines += [ "OS_DARWIN=1" ]
69   } else {
70     sources -= [
71       "src/libusb/os/darwin_usb.c",
72       "src/libusb/os/darwin_usb.h",
73     ]
74   }
76   if (is_linux) {
77     defines += [
78       "HAVE_LIBUDEV=1",
79       "OS_LINUX=1",
80       "USE_UDEV=1",
81       "_GNU_SOURCE=1",
82     ]
83     deps += [ "//build/config/linux:udev" ]
84   } else {
85     sources -= [
86       "src/libusb/os/linux_udev.cc",
87       "src/libusb/os/linux_usbfs.c",
88       "src/libusb/os/linux_usbfs.h",
89     ]
90   }
92   if (is_win) {
93     include_dirs += [ "src/msvc" ]
94     sources -= [
95       "src/libusb/os/poll_posix.c",
96       "src/libusb/os/threads_posix.c",
97     ]
98   } else {
99     include_dirs += [ "src" ]
100     sources -= [
101       "src/libusb/os/poll_windows.c",
102       "src/libusb/os/poll_windows.h",
103       "src/libusb/os/threads_windows.c",
104       "src/libusb/os/threads_windows.h",
105       "src/libusb/os/windows_common.h",
106       "src/libusb/os/windows_usb.c",
107       "src/libusb/os/windows_usb.h",
108       "src/msvc/config.h",
109       "src/msvc/inttypes.h",
110       "src/msvc/stdint.h",
111     ]
112   }