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 import("//build/config/features.gni")
9 config("libusb_config") {
10 include_dirs = [ "src/libusb" ]
13 static_library("libusb") {
17 "src/libusb/descriptor.c",
18 "src/libusb/hotplug.c",
19 "src/libusb/hotplug.h",
20 "src/libusb/interrupt.c",
21 "src/libusb/interrupt.h",
23 "src/libusb/libusb.h",
24 "src/libusb/libusbi.h",
25 "src/libusb/os/darwin_usb.c",
26 "src/libusb/os/darwin_usb.h",
27 "src/libusb/os/poll_posix.c",
28 "src/libusb/os/poll_posix.h",
29 "src/libusb/os/poll_windows.c",
30 "src/libusb/os/poll_windows.h",
31 "src/libusb/os/threads_posix.c",
32 "src/libusb/os/threads_posix.h",
33 "src/libusb/os/threads_windows.c",
34 "src/libusb/os/threads_windows.h",
35 "src/libusb/os/windows_common.h",
36 "src/libusb/os/windows_usb.c",
37 "src/libusb/os/windows_usb.h",
38 "src/libusb/strerror.c",
40 "src/libusb/version.h",
41 "src/libusb/version_nano.h",
43 "src/msvc/inttypes.h",
47 include_dirs = [ "src/libusb/os" ]
49 configs -= [ "//build/config/compiler:chromium_code" ]
50 configs += [ "//build/config/compiler:no_chromium_code" ]
52 public_configs = [ ":libusb_config" ]
56 "DEFAULT_VISIBILITY=",
57 "HAVE_GETTIMEOFDAY=1",
60 "LIBUSB_DESCRIBE=\"1.0.16\"",
61 "POLL_NFDS_TYPE=nfds_t",
67 defines += [ "OS_DARWIN=1" ]
70 "src/libusb/os/darwin_usb.c",
71 "src/libusb/os/darwin_usb.h",
77 "src/libusb/os/linux_usbfs.c",
78 "src/libusb/os/linux_usbfs.h",
87 sources += [ "src/libusb/os/linux_udev.cc" ]
92 deps += [ "//build/config/linux:udev" ]
95 if (is_linux && !use_udev) {
96 sources += [ "src/libusb/os/linux_netlink.c" ]
97 defines += [ "HAVE_LINUX_NETLINK_H" ]
99 cflags += [ "-Wno-pointer-sign" ]
104 include_dirs += [ "src/msvc" ]
106 "src/libusb/os/poll_posix.c",
107 "src/libusb/os/threads_posix.c",
109 libs = [ "setupapi.lib" ]
111 include_dirs += [ "src" ]
113 "src/libusb/os/poll_windows.c",
114 "src/libusb/os/poll_windows.h",
115 "src/libusb/os/threads_windows.c",
116 "src/libusb/os/threads_windows.h",
117 "src/libusb/os/windows_common.h",
118 "src/libusb/os/windows_usb.c",
119 "src/libusb/os/windows_usb.h",
121 "src/msvc/inttypes.h",