OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 assert(!is_android && !is_ios) | 5 assert(!is_android && !is_ios) |
6 | 6 |
7 import("//build/config/features.gni") | 7 import("//build/config/features.gni") |
8 | 8 |
9 config("libusb_config") { | 9 config("libusb_config") { |
10 include_dirs = [ "src/libusb" ] | 10 include_dirs = [ "src/libusb" ] |
(...skipping 28 matching lines...) Expand all Loading... |
39 "src/libusb/sync.c", | 39 "src/libusb/sync.c", |
40 "src/libusb/version.h", | 40 "src/libusb/version.h", |
41 "src/libusb/version_nano.h", | 41 "src/libusb/version_nano.h", |
42 "src/msvc/config.h", | 42 "src/msvc/config.h", |
43 "src/msvc/inttypes.h", | 43 "src/msvc/inttypes.h", |
44 "src/msvc/stdint.h", | 44 "src/msvc/stdint.h", |
45 ] | 45 ] |
46 deps = [] | 46 deps = [] |
47 include_dirs = [ "src/libusb/os" ] | 47 include_dirs = [ "src/libusb/os" ] |
48 | 48 |
| 49 config("libusb_warnings") { |
| 50 if (is_clang) { |
| 51 # guid_eq in windows_usb.c is unused. |
| 52 cflags = [ "-Wno-unused-function" ] |
| 53 if (is_linux && !use_udev) { |
| 54 cflags += [ "-Wno-pointer-sign" ] |
| 55 } |
| 56 } |
| 57 } |
49 configs -= [ "//build/config/compiler:chromium_code" ] | 58 configs -= [ "//build/config/compiler:chromium_code" ] |
50 configs += [ "//build/config/compiler:no_chromium_code" ] | 59 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 60 configs += [ ":libusb_warnings" ] |
51 | 61 |
52 public_configs = [ ":libusb_config" ] | 62 public_configs = [ ":libusb_config" ] |
53 | 63 |
54 if (is_posix) { | 64 if (is_posix) { |
55 defines = [ | 65 defines = [ |
56 "DEFAULT_VISIBILITY=", | 66 "DEFAULT_VISIBILITY=", |
57 "HAVE_GETTIMEOFDAY=1", | 67 "HAVE_GETTIMEOFDAY=1", |
58 "HAVE_POLL_H=1", | 68 "HAVE_POLL_H=1", |
59 "HAVE_SYS_TIME_H=1", | 69 "HAVE_SYS_TIME_H=1", |
60 "LIBUSB_DESCRIBE=\"1.0.16\"", | 70 "LIBUSB_DESCRIBE=\"1.0.16\"", |
(...skipping 27 matching lines...) Expand all Loading... |
88 defines += [ | 98 defines += [ |
89 "HAVE_LIBUDEV=1", | 99 "HAVE_LIBUDEV=1", |
90 "USE_UDEV=1", | 100 "USE_UDEV=1", |
91 ] | 101 ] |
92 deps += [ "//build/config/linux:udev" ] | 102 deps += [ "//build/config/linux:udev" ] |
93 } | 103 } |
94 | 104 |
95 if (is_linux && !use_udev) { | 105 if (is_linux && !use_udev) { |
96 sources += [ "src/libusb/os/linux_netlink.c" ] | 106 sources += [ "src/libusb/os/linux_netlink.c" ] |
97 defines += [ "HAVE_LINUX_NETLINK_H" ] | 107 defines += [ "HAVE_LINUX_NETLINK_H" ] |
98 if (is_clang) { | |
99 cflags += [ "-Wno-pointer-sign" ] | |
100 } | |
101 } | 108 } |
102 | 109 |
103 if (is_win) { | 110 if (is_win) { |
104 include_dirs += [ "src/msvc" ] | 111 include_dirs += [ "src/msvc" ] |
105 sources -= [ | 112 sources -= [ |
106 "src/libusb/os/poll_posix.c", | 113 "src/libusb/os/poll_posix.c", |
107 "src/libusb/os/threads_posix.c", | 114 "src/libusb/os/threads_posix.c", |
108 ] | 115 ] |
109 libs = [ "setupapi.lib" ] | 116 libs = [ "setupapi.lib" ] |
110 } else { | 117 } else { |
111 include_dirs += [ "src" ] | 118 include_dirs += [ "src" ] |
112 sources -= [ | 119 sources -= [ |
113 "src/libusb/os/poll_windows.c", | 120 "src/libusb/os/poll_windows.c", |
114 "src/libusb/os/poll_windows.h", | 121 "src/libusb/os/poll_windows.h", |
115 "src/libusb/os/threads_windows.c", | 122 "src/libusb/os/threads_windows.c", |
116 "src/libusb/os/threads_windows.h", | 123 "src/libusb/os/threads_windows.h", |
117 "src/libusb/os/windows_common.h", | 124 "src/libusb/os/windows_common.h", |
118 "src/libusb/os/windows_usb.c", | 125 "src/libusb/os/windows_usb.c", |
119 "src/libusb/os/windows_usb.h", | 126 "src/libusb/os/windows_usb.h", |
120 "src/msvc/config.h", | 127 "src/msvc/config.h", |
121 "src/msvc/inttypes.h", | 128 "src/msvc/inttypes.h", |
122 "src/msvc/stdint.h", | 129 "src/msvc/stdint.h", |
123 ] | 130 ] |
124 } | 131 } |
125 } | 132 } |
OLD | NEW |