summaryrefslogtreecommitdiff
path: root/chromium/remoting/host/file_transfer/BUILD.gn
blob: 1733248794dc8c453e56d67d02de2232acaaa6b7 (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
# Copyright 2018 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("//remoting/build/config/remoting_build.gni")

source_set("file_transfer") {
  sources = [ "get_desktop_directory.h" ]

  public_deps = [ ":common" ]

  deps = [
    "//base",
    "//remoting/protocol",
    "//remoting/resources",
  ]

  if (is_mac) {
    sources += [
      "ensure_user_mac.cc",
      "file_chooser_mac.mm",
    ]
    frameworks = [ "AppKit.framework" ]
  }

  if (!is_mac && !is_win) {
    sources += [ "ensure_user_no_op.cc" ]
  }

  if (is_win) {
    sources += [
      "ensure_user_win.cc",
      "file_chooser_common_win.h",
      "file_chooser_main_win.cc",
      "file_chooser_win.cc",
      "get_desktop_directory_win.cc",
    ]
  } else {
    sources += [ "get_desktop_directory.cc" ]
  }

  if (is_linux) {
    sources += [ "file_chooser_linux.cc" ]
    deps += [ "//build/config/linux/gtk" ]
  }

  if (is_chromeos) {
    sources += [ "file_chooser_chromeos.cc" ]
  }
}

source_set("common") {
  public = [
    "file_operations.h",
    "file_transfer_message_handler.h",
    "ipc_file_operations.h",
    "local_file_operations.h",
    "rtc_log_file_operations.h",
    "session_file_operations_handler.h",
  ]

  sources = [
    "buffered_file_writer.cc",
    "buffered_file_writer.h",
    "ensure_user.h",
    "file_chooser.h",
    "file_transfer_message_handler.cc",
    "ipc_file_operations.cc",
    "local_file_operations.cc",
    "rtc_log_file_operations.cc",
    "session_file_operations_handler.cc",
  ]

  deps = [
    "//base",
    "//remoting/protocol",
  ]
}

source_set("test_support") {
  testonly = true

  sources = [
    "ensure_user_no_op.cc",
    "fake_file_chooser.cc",
    "fake_file_chooser.h",
    "fake_file_operations.cc",
    "fake_file_operations.h",
    "get_desktop_directory.cc",
    "test_byte_vector_utils.h",
  ]
  deps = [
    ":common",
    "//remoting/protocol",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "buffered_file_writer_unittest.cc",
    "file_transfer_message_handler_unittest.cc",
    "ipc_file_operations_unittest.cc",
    "local_file_operations_unittest.cc",
    "rtc_log_file_operations_unittest.cc",
  ]

  deps = [
    ":common",
    ":test_support",
    "//remoting/protocol",
    "//testing/gtest",
  ]
}