summaryrefslogtreecommitdiffstats
path: root/components/storage_monitor/BUILD.gn
blob: 48b34d04380cc64a170779da19209ded505d3106 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/features.gni")

# GYP version: components/storage_monitor.gypi:storage_monitor
static_library("storage_monitor") {
  sources = [
    "image_capture_device.h",
    "image_capture_device.mm",
    "image_capture_device_manager.h",
    "image_capture_device_manager.mm",
    "media_storage_util.cc",
    "media_storage_util.h",
    "media_transfer_protocol_device_observer_linux.cc",
    "media_transfer_protocol_device_observer_linux.h",
    "mtab_watcher_linux.cc",
    "mtab_watcher_linux.h",
    "portable_device_watcher_win.cc",
    "portable_device_watcher_win.h",
    "removable_device_constants.cc",
    "removable_device_constants.h",
    "removable_storage_observer.h",
    "storage_info.cc",
    "storage_info.h",
    "storage_monitor.cc",
    "storage_monitor.h",
    "storage_monitor_chromeos.cc",
    "storage_monitor_chromeos.h",
    "storage_monitor_linux.cc",
    "storage_monitor_linux.h",
    "storage_monitor_mac.h",
    "storage_monitor_mac.mm",
    "storage_monitor_win.cc",
    "storage_monitor_win.h",
    "transient_device_ids.cc",
    "transient_device_ids.h",
    "udev_util_linux.cc",
    "udev_util_linux.h",
    "volume_mount_watcher_win.cc",
    "volume_mount_watcher_win.h",
  ]

  deps = [
    "//base",
  ]

  if (is_mac) {
    libs = [
      "DiskArbitration.framework",
      "Foundation.framework",
      "ImageCaptureCore.framework",
    ]
  }

  if (is_linux) {
    deps += [
      "//device/media_transfer_protocol",
      "//device/media_transfer_protocol:mtp_file_entry_proto",
      "//device/media_transfer_protocol:mtp_storage_info_proto",
    ]
  }

  if (use_udev) {
    deps += [ "//device/udev_linux" ]
  } else if (is_linux) {
    # These were already removed for non-Linux.
    sources -= [
      "storage_monitor_linux.cc",
      "storage_monitor_linux.h",
      "udev_util_linux.cc",
      "udev_util_linux.h",
    ]
  }

  if (is_chromeos) {
    sources -= [
      "mtab_watcher_linux.cc",
      "mtab_watcher_linux.h",
      "storage_monitor_linux.cc",
      "storage_monitor_linux.h",
    ]
  }
}

# GYP version: components/storage_monitor.gypi:storage_monitor_test_support
static_library("test_support") {
  sources = [
    "mock_removable_storage_observer.cc",
    "mock_removable_storage_observer.h",
    "test_media_transfer_protocol_manager_linux.cc",
    "test_media_transfer_protocol_manager_linux.h",
    "test_portable_device_watcher_win.cc",
    "test_portable_device_watcher_win.h",
    "test_storage_monitor.cc",
    "test_storage_monitor.h",
    "test_storage_monitor_win.cc",
    "test_storage_monitor_win.h",
    "test_volume_mount_watcher_win.cc",
    "test_volume_mount_watcher_win.h",
  ]

  deps = [
    "//base",
    ":storage_monitor",
  ]

  if (is_linux) {
    deps += [
      "//device/media_transfer_protocol",
      "//device/media_transfer_protocol:mtp_file_entry_proto",
      "//device/media_transfer_protocol:mtp_storage_info_proto",
    ]
  }
}