Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / device / usb / BUILD.gn
blobc30ae56e500287be62767bb69e5106600a5f36a4
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.cc",
23     "usb_device_handle.h",
24     "usb_device_handle_impl.cc",
25     "usb_device_handle_impl.h",
26     "usb_device_impl.cc",
27     "usb_device_impl.h",
28     "usb_error.cc",
29     "usb_error.h",
30     "usb_ids.cc",
31     "usb_ids.h",
32     "usb_service.cc",
33     "usb_service.h",
34     "usb_service_impl.cc",
35     "usb_service_impl.h",
36     "webusb_descriptors.cc",
37     "webusb_descriptors.h",
38     generated_ids,
39   ]
41   deps = [
42     ":usb_device_ids",
43     "//base",
44     "//base/third_party/dynamic_annotations",
45     "//components/device_event_log",
46     "//device/core",
47     "//net",
48     "//third_party/libusb",
49   ]
51   if (use_udev) {
52     deps += [ "//device/udev_linux" ]
53   }
54   if (is_chromeos) {
55     deps += [
56       "//chromeos",
57       "//dbus",
58     ]
59   }
62 source_set("mocks") {
63   testonly = true
65   sources = [
66     "mock_usb_device.cc",
67     "mock_usb_device.h",
68     "mock_usb_device_handle.cc",
69     "mock_usb_device_handle.h",
70     "mock_usb_service.cc",
71     "mock_usb_service.h",
72   ]
74   deps = [
75     "//base",
76     "//testing/gmock",
77     ":usb",
78   ]
81 action("usb_device_ids") {
82   script = "//device/usb/tools/usb_ids.py"
83   inputs = [
84     source_ids,
85   ]
86   outputs = [
87     generated_ids,
88   ]
89   args = [
90     "-i",
91     rebase_path(source_ids, root_build_dir),
92     "-o",
93     rebase_path(generated_ids, root_build_dir),
94   ]
96   # Only the device_usb target can depend on us.
97   visibility = [ ":usb" ]