Fix broken channel icon in chrome://help on CrOS
[chromium-blink-merge.git] / device / usb / BUILD.gn
blob9f4b19f67d6c9371e0918e4b1fee7a20c876c64b
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
3 # found in the LICENSE file.
5 import("//build/config/features.gni")
7 assert(!is_android && !is_ios)
9 source_ids = "//third_party/usb_ids/usb.ids"
10 generated_ids = "$target_gen_dir/usb_ids_gen.cc"
12 source_set("usb") {
13   sources = [
14     "usb_context.cc",
15     "usb_context.h",
16     "usb_descriptors.cc",
17     "usb_descriptors.h",
18     "usb_device.cc",
19     "usb_device.h",
20     "usb_device_filter.cc",
21     "usb_device_filter.h",
22     "usb_device_handle.h",
23     "usb_device_handle_impl.cc",
24     "usb_device_handle_impl.h",
25     "usb_device_impl.cc",
26     "usb_device_impl.h",
27     "usb_error.cc",
28     "usb_error.h",
29     "usb_ids.cc",
30     "usb_ids.h",
31     "usb_service.cc",
32     "usb_service.h",
33     "usb_service_impl.cc",
34     "usb_service_impl.h",
35     "webusb_descriptors.cc",
36     "webusb_descriptors.h",
37     generated_ids,
38   ]
40   deps = [
41     ":usb_device_ids",
42     "//base",
43     "//base/third_party/dynamic_annotations",
44     "//components/device_event_log",
45     "//device/core",
46     "//net",
47     "//third_party/libusb",
48   ]
50   if (use_udev) {
51     deps += [ "//device/udev_linux" ]
52   }
53   if (is_chromeos) {
54     deps += [
55       "//chromeos",
56       "//dbus",
57     ]
58   }
61 source_set("mocks") {
62   testonly = true
64   sources = [
65     "mock_usb_device.cc",
66     "mock_usb_device.h",
67     "mock_usb_device_handle.cc",
68     "mock_usb_device_handle.h",
69     "mock_usb_service.cc",
70     "mock_usb_service.h",
71   ]
73   deps = [
74     "//base",
75     "//testing/gmock",
76     ":usb",
77   ]
80 action("usb_device_ids") {
81   script = "//device/usb/tools/usb_ids.py"
82   inputs = [
83     source_ids,
84   ]
85   outputs = [
86     generated_ids,
87   ]
88   args = [
89     "-i",
90     rebase_path(source_ids, root_build_dir),
91     "-o",
92     rebase_path(generated_ids, root_build_dir),
93   ]
95   # Only the device_usb target can depend on us.
96   visibility = [ ":usb" ]