Rename GetIconID to GetIconId
[chromium-blink-merge.git] / components / storage_monitor / BUILD.gn
blobccb33cea904163e1565fd1b5a57c507d1143e315
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
3 # found in the LICENSE file.
5 import("//build/config/features.gni")
7 # GYP version: components/storage_monitor.gypi:storage_monitor
8 source_set("storage_monitor") {
9   sources = [
10     "image_capture_device.h",
11     "image_capture_device.mm",
12     "image_capture_device_manager.h",
13     "image_capture_device_manager.mm",
14     "media_storage_util.cc",
15     "media_storage_util.h",
16     "media_transfer_protocol_device_observer_linux.cc",
17     "media_transfer_protocol_device_observer_linux.h",
18     "mtab_watcher_linux.cc",
19     "mtab_watcher_linux.h",
20     "portable_device_watcher_win.cc",
21     "portable_device_watcher_win.h",
22     "removable_device_constants.cc",
23     "removable_device_constants.h",
24     "removable_storage_observer.h",
25     "storage_info.cc",
26     "storage_info.h",
27     "storage_monitor.cc",
28     "storage_monitor.h",
29     "storage_monitor_chromeos.cc",
30     "storage_monitor_chromeos.h",
31     "storage_monitor_linux.cc",
32     "storage_monitor_linux.h",
33     "storage_monitor_mac.h",
34     "storage_monitor_mac.mm",
35     "storage_monitor_win.cc",
36     "storage_monitor_win.h",
37     "transient_device_ids.cc",
38     "transient_device_ids.h",
39     "udev_util_linux.cc",
40     "udev_util_linux.h",
41     "volume_mount_watcher_win.cc",
42     "volume_mount_watcher_win.h",
43   ]
45   deps = [
46     "//base",
47   ]
49   if (is_mac) {
50     libs = [
51       "DiskArbitration.framework",
52       "Foundation.framework",
53       "ImageCaptureCore.framework",
54     ]
55   }
57   if (is_linux) {
58     deps += [
59       "//device/media_transfer_protocol",
60       "//device/media_transfer_protocol:mtp_file_entry_proto",
61       "//device/media_transfer_protocol:mtp_storage_info_proto",
62     ]
63   }
65   if (use_udev) {
66     deps += [ "//device/udev_linux" ]
67   } else if (is_linux) {
68     # These were already removed for non-Linux.
69     sources -= [
70       "storage_monitor_linux.cc",
71       "storage_monitor_linux.h",
72       "udev_util_linux.cc",
73       "udev_util_linux.h",
74     ]
75   }
77   if (is_chromeos) {
78     sources -= [
79       "mtab_watcher_linux.cc",
80       "mtab_watcher_linux.h",
81       "storage_monitor_linux.cc",
82       "storage_monitor_linux.h",
83     ]
84   }
87 # GYP version: components/storage_monitor.gypi:storage_monitor_test_support
88 source_set("test_support") {
89   sources = [
90     "mock_removable_storage_observer.cc",
91     "mock_removable_storage_observer.h",
92     "test_media_transfer_protocol_manager_linux.cc",
93     "test_media_transfer_protocol_manager_linux.h",
94     "test_portable_device_watcher_win.cc",
95     "test_portable_device_watcher_win.h",
96     "test_storage_monitor.cc",
97     "test_storage_monitor.h",
98     "test_storage_monitor_win.cc",
99     "test_storage_monitor_win.h",
100     "test_volume_mount_watcher_win.cc",
101     "test_volume_mount_watcher_win.h",
102   ]
104   public_deps = [
105     ":storage_monitor",
106     "//base",
107   ]
109   if (is_linux) {
110     deps = [
111       "//device/media_transfer_protocol",
112       "//device/media_transfer_protocol:mtp_file_entry_proto",
113       "//device/media_transfer_protocol:mtp_storage_info_proto",
114     ]
115   }
118 source_set("unit_tests") {
119   testonly = true
120   sources = [
121     "image_capture_device_manager_unittest.mm",
122     "media_storage_util_unittest.cc",
123     "media_transfer_protocol_device_observer_linux_unittest.cc",
124     "storage_info_unittest.cc",
125     "storage_monitor_mac_unittest.mm",
126     "storage_monitor_unittest.cc",
127     "storage_monitor_win_unittest.cc",
128   ]
130   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
132   deps = [
133     ":test_support",
134     "//testing/gtest",
135   ]
137   if (is_linux && !is_chromeos) {
138     sources += [ "storage_monitor_linux_unittest.cc" ]
139   }
140   if (is_chromeos) {
141     sources += [ "storage_monitor_chromeos_unittest.cc" ]
142     deps += [
143       "//chromeos:test_support",
144       "//testing/gmock",
145     ]
146   }