Roll src/third_party/skia 89d5988:cb67414
[chromium-blink-merge.git] / device / usb / BUILD.gn
blobea0248a464855b4c5f02eb2cf19756a4e6adcc06
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 assert(!is_android && !is_ios)
7 source_ids = "//third_party/usb_ids/usb.ids"
8 generated_ids = "$target_gen_dir/usb_ids_gen.cc"
10 source_set("usb") {
11   sources = [
12     "device_impl.cc",
13     "device_impl.h",
14     "device_manager_impl.cc",
15     "device_manager_impl.h",
16     "type_converters.cc",
17     "type_converters.h",
18     "usb_context.cc",
19     "usb_context.h",
20     "usb_descriptors.cc",
21     "usb_descriptors.h",
22     "usb_device.cc",
23     "usb_device.h",
24     "usb_device_filter.cc",
25     "usb_device_filter.h",
26     "usb_device_handle.h",
27     "usb_device_handle_impl.cc",
28     "usb_device_handle_impl.h",
29     "usb_device_impl.cc",
30     "usb_device_impl.h",
31     "usb_error.cc",
32     "usb_error.h",
33     "usb_ids.cc",
34     "usb_ids.h",
35     "usb_service.cc",
36     "usb_service.h",
37     "usb_service_impl.cc",
38     "usb_service_impl.h",
39     generated_ids,
40   ]
42   deps = [
43     ":usb_device_ids",
44     "//base",
45     "//base/third_party/dynamic_annotations",
46     "//components/device_event_log",
47     "//device/core",
48     "//device/usb/public/cpp",
49     "//mojo/environment:chromium",
50     "//net",
51     "//third_party/libusb",
52     "//third_party/mojo/src/mojo/edk/system",
53   ]
55   public_deps = [
56     "//device/usb/public/interfaces",
57     "//third_party/mojo/src/mojo/public/cpp/bindings",
58     "//third_party/mojo/src/mojo/public/cpp/bindings:callback",
59   ]
61   if (is_linux) {
62     deps += [ "//device/udev_linux" ]
63   }
64   if (is_chromeos) {
65     deps += [ "//chromeos" ]
66   }
69 source_set("mocks") {
70   testonly = true
72   sources = [
73     "mock_usb_device.cc",
74     "mock_usb_device.h",
75     "mock_usb_device_handle.cc",
76     "mock_usb_device_handle.h",
77     "mock_usb_service.cc",
78     "mock_usb_service.h",
79   ]
81   deps = [
82     "//base",
83     "//testing/gmock",
84     ":usb",
85   ]
88 action("usb_device_ids") {
89   script = "//device/usb/tools/usb_ids.py"
90   inputs = [
91     source_ids,
92   ]
93   outputs = [
94     generated_ids,
95   ]
96   args = [
97     "-i",
98     rebase_path(source_ids, root_build_dir),
99     "-o",
100     rebase_path(generated_ids, root_build_dir),
101   ]
103   # Only the device_usb target can depend on us.
104   visibility = [ ":usb" ]