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