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" ] |
11 } | 11 } |
12 | 12 |
| 13 config("libusb_warnings") { |
| 14 visibility = [ ":*" ] |
| 15 if (is_clang) { |
| 16 # guid_eq in windows_usb.c is unused. |
| 17 cflags = [ "-Wno-unused-function" ] |
| 18 if (is_linux && !use_udev) { |
| 19 cflags += [ "-Wno-pointer-sign" ] |
| 20 } |
| 21 } |
| 22 } |
| 23 |
13 static_library("libusb") { | 24 static_library("libusb") { |
14 sources = [ | 25 sources = [ |
15 "src/config.h", | 26 "src/config.h", |
16 "src/libusb/core.c", | 27 "src/libusb/core.c", |
17 "src/libusb/descriptor.c", | 28 "src/libusb/descriptor.c", |
18 "src/libusb/hotplug.c", | 29 "src/libusb/hotplug.c", |
19 "src/libusb/hotplug.h", | 30 "src/libusb/hotplug.h", |
20 "src/libusb/interrupt.c", | 31 "src/libusb/interrupt.c", |
21 "src/libusb/interrupt.h", | 32 "src/libusb/interrupt.h", |
22 "src/libusb/io.c", | 33 "src/libusb/io.c", |
(...skipping 16 matching lines...) Expand all Loading... |
39 "src/libusb/sync.c", | 50 "src/libusb/sync.c", |
40 "src/libusb/version.h", | 51 "src/libusb/version.h", |
41 "src/libusb/version_nano.h", | 52 "src/libusb/version_nano.h", |
42 "src/msvc/config.h", | 53 "src/msvc/config.h", |
43 "src/msvc/inttypes.h", | 54 "src/msvc/inttypes.h", |
44 "src/msvc/stdint.h", | 55 "src/msvc/stdint.h", |
45 ] | 56 ] |
46 deps = [] | 57 deps = [] |
47 include_dirs = [ "src/libusb/os" ] | 58 include_dirs = [ "src/libusb/os" ] |
48 | 59 |
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 } | |
58 configs -= [ "//build/config/compiler:chromium_code" ] | 60 configs -= [ "//build/config/compiler:chromium_code" ] |
59 configs += [ "//build/config/compiler:no_chromium_code" ] | 61 configs += [ "//build/config/compiler:no_chromium_code" ] |
60 configs += [ ":libusb_warnings" ] | 62 configs += [ ":libusb_warnings" ] |
61 | 63 |
62 public_configs = [ ":libusb_config" ] | 64 public_configs = [ ":libusb_config" ] |
63 | 65 |
64 if (is_posix) { | 66 if (is_posix) { |
65 defines = [ | 67 defines = [ |
66 "DEFAULT_VISIBILITY=", | 68 "DEFAULT_VISIBILITY=", |
67 "HAVE_GETTIMEOFDAY=1", | 69 "HAVE_GETTIMEOFDAY=1", |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 "src/libusb/os/threads_windows.h", | 125 "src/libusb/os/threads_windows.h", |
124 "src/libusb/os/windows_common.h", | 126 "src/libusb/os/windows_common.h", |
125 "src/libusb/os/windows_usb.c", | 127 "src/libusb/os/windows_usb.c", |
126 "src/libusb/os/windows_usb.h", | 128 "src/libusb/os/windows_usb.h", |
127 "src/msvc/config.h", | 129 "src/msvc/config.h", |
128 "src/msvc/inttypes.h", | 130 "src/msvc/inttypes.h", |
129 "src/msvc/stdint.h", | 131 "src/msvc/stdint.h", |
130 ] | 132 ] |
131 } | 133 } |
132 } | 134 } |
OLD | NEW |