OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 import("//build/config/features.gni") | 5 import("//build/config/features.gni") |
6 | 6 |
7 assert(!is_ios) | 7 assert(!is_ios) |
8 | 8 |
9 if (is_android) { | |
10 import("//build/config/android/rules.gni") # For generate_jni(). | |
11 } | |
12 | |
13 source_ids = "//third_party/usb_ids/usb.ids" | 9 source_ids = "//third_party/usb_ids/usb.ids" |
14 generated_ids = "$target_gen_dir/usb_ids_gen.cc" | 10 generated_ids = "$target_gen_dir/usb_ids_gen.cc" |
15 | 11 |
16 source_set("usb") { | 12 source_set("usb") { |
17 sources = [ | 13 sources = [ |
18 "android/usb_jni_registrar.cc", | |
19 "android/usb_jni_registrar.h", | |
20 "usb_configuration_android.cc", | |
21 "usb_configuration_android.h", | |
22 "usb_descriptors.cc", | 14 "usb_descriptors.cc", |
23 "usb_descriptors.h", | 15 "usb_descriptors.h", |
24 "usb_device.cc", | 16 "usb_device.cc", |
25 "usb_device.h", | 17 "usb_device.h", |
26 "usb_device_android.cc", | |
27 "usb_device_android.h", | |
28 "usb_device_filter.cc", | 18 "usb_device_filter.cc", |
29 "usb_device_filter.h", | 19 "usb_device_filter.h", |
30 "usb_device_handle.cc", | 20 "usb_device_handle.cc", |
31 "usb_device_handle.h", | 21 "usb_device_handle.h", |
32 "usb_endpoint_android.cc", | |
33 "usb_endpoint_android.h", | |
34 "usb_ids.cc", | 22 "usb_ids.cc", |
35 "usb_ids.h", | 23 "usb_ids.h", |
36 "usb_interface_android.cc", | |
37 "usb_interface_android.h", | |
38 "usb_service.cc", | 24 "usb_service.cc", |
39 "usb_service.h", | 25 "usb_service.h", |
40 "usb_service_android.cc", | |
41 "usb_service_android.h", | |
42 "webusb_descriptors.cc", | 26 "webusb_descriptors.cc", |
43 "webusb_descriptors.h", | 27 "webusb_descriptors.h", |
44 generated_ids, | 28 generated_ids, |
45 ] | 29 ] |
46 | 30 |
47 deps = [ | 31 deps = [ |
48 ":usb_device_ids", | 32 ":usb_device_ids", |
49 "//base", | 33 "//base", |
50 "//base/third_party/dynamic_annotations", | 34 "//base/third_party/dynamic_annotations", |
51 "//components/device_event_log", | 35 "//components/device_event_log", |
52 "//device/core", | 36 "//device/core", |
53 "//net", | 37 "//net", |
54 ] | 38 ] |
55 | 39 |
56 if (use_udev) { | 40 if (use_udev) { |
57 deps += [ "//device/udev_linux" ] | 41 deps += [ "//device/udev_linux" ] |
58 } | 42 } |
59 | 43 |
60 if (is_android) { | 44 if (is_android) { |
61 deps += [ ":jni_headers" ] | 45 sources += [ |
| 46 "usb_service_android.cc", |
| 47 "usb_service_android.h", |
| 48 ] |
62 } else { | 49 } else { |
63 sources += [ | 50 sources += [ |
64 "usb_context.cc", | 51 "usb_context.cc", |
65 "usb_context.h", | 52 "usb_context.h", |
66 "usb_device_handle_impl.cc", | 53 "usb_device_handle_impl.cc", |
67 "usb_device_handle_impl.h", | 54 "usb_device_handle_impl.h", |
68 "usb_device_impl.cc", | 55 "usb_device_impl.cc", |
69 "usb_device_impl.h", | 56 "usb_device_impl.h", |
70 "usb_error.cc", | 57 "usb_error.cc", |
71 "usb_error.h", | 58 "usb_error.h", |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 args = [ | 104 args = [ |
118 "-i", | 105 "-i", |
119 rebase_path(source_ids, root_build_dir), | 106 rebase_path(source_ids, root_build_dir), |
120 "-o", | 107 "-o", |
121 rebase_path(generated_ids, root_build_dir), | 108 rebase_path(generated_ids, root_build_dir), |
122 ] | 109 ] |
123 | 110 |
124 # Only the device_usb target can depend on us. | 111 # Only the device_usb target can depend on us. |
125 visibility = [ ":usb" ] | 112 visibility = [ ":usb" ] |
126 } | 113 } |
127 | |
128 if (is_android) { | |
129 java_sources_needing_jni = [ | |
130 "android/java/src/org/chromium/device/usb/ChromeUsbConfiguration.java", | |
131 "android/java/src/org/chromium/device/usb/ChromeUsbDevice.java", | |
132 "android/java/src/org/chromium/device/usb/ChromeUsbEndpoint.java", | |
133 "android/java/src/org/chromium/device/usb/ChromeUsbInterface.java", | |
134 "android/java/src/org/chromium/device/usb/ChromeUsbService.java", | |
135 ] | |
136 | |
137 generate_jni("jni_headers") { | |
138 sources = java_sources_needing_jni | |
139 jni_package = "device" | |
140 } | |
141 | |
142 java_cpp_enum("usb_descriptors_javagen") { | |
143 sources = [ | |
144 "usb_descriptors.h", | |
145 ] | |
146 } | |
147 | |
148 android_library("java") { | |
149 java_files = java_sources_needing_jni | |
150 deps = [ | |
151 "//base:base_java", | |
152 ] | |
153 srcjar_deps = [ ":usb_descriptors_javagen" ] | |
154 } | |
155 } | |
OLD | NEW |