Upload upstream chromium 114.0.5735.31
[platform/framework/web/chromium-efl.git] / services / device / serial / BUILD.gn
1 # Copyright 2017 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//build/config/chromeos/ui_mode.gni")
6 import("//build/config/features.gni")
7
8 if (is_win || ((is_linux || is_tizen || is_chromeos) && use_udev) || is_mac) {
9   config("platform_support") {
10     visibility = [ ":serial" ]
11     if (is_win) {
12       libs = [ "setupapi.lib" ]
13       ldflags = [ "/DELAYLOAD:setupapi.dll" ]
14     }
15   }
16
17   source_set("serial") {
18     visibility = [
19       ":test_support",
20       "//services/device:lib",
21       "//services/device:tests",
22     ]
23
24     sources = [
25       "bluetooth_serial_device_enumerator.cc",
26       "bluetooth_serial_device_enumerator.h",
27       "bluetooth_serial_port_impl.cc",
28       "bluetooth_serial_port_impl.h",
29       "serial_device_enumerator.cc",
30       "serial_device_enumerator.h",
31       "serial_io_handler.cc",
32       "serial_io_handler.h",
33       "serial_port_impl.cc",
34       "serial_port_impl.h",
35       "serial_port_manager_impl.cc",
36       "serial_port_manager_impl.h",
37     ]
38
39     public_configs = [ ":platform_support" ]
40
41     public_deps = [ "//services/device/public/mojom" ]
42
43     deps = [
44       "//base",
45       "//build:chromeos_buildflags",
46       "//components/device_event_log",
47       "//device/bluetooth:bluetooth",
48       "//device/bluetooth/public/cpp",
49       "//mojo/public/cpp/bindings",
50       "//net",
51       "//services/device/public/cpp:device_features",
52       "//services/device/public/cpp/bluetooth:bluetooth",
53       "//services/device/public/cpp/serial:switches",
54     ]
55
56     if (is_linux || is_chromeos) {
57       sources += [
58         "serial_device_enumerator_linux.cc",
59         "serial_device_enumerator_linux.h",
60       ]
61     }
62
63     if (is_mac) {
64       sources += [
65         "serial_device_enumerator_mac.cc",
66         "serial_device_enumerator_mac.h",
67       ]
68     }
69
70     if (is_win) {
71       sources += [
72         "serial_device_enumerator_win.cc",
73         "serial_device_enumerator_win.h",
74         "serial_io_handler_win.cc",
75         "serial_io_handler_win.h",
76       ]
77     }
78
79     if (is_posix) {
80       sources += [
81         "serial_io_handler_posix.cc",
82         "serial_io_handler_posix.h",
83       ]
84     }
85
86     if (use_udev) {
87       deps += [ "//device/udev_linux" ]
88     }
89
90     if (is_chromeos_ash) {
91       deps += [ "//chromeos/dbus/permission_broker" ]
92     }
93
94     if (is_mac) {
95       frameworks = [
96         "Foundation.framework",
97         "IOKit.framework",
98       ]
99     }
100
101     if (is_win) {
102       deps += [
103         "//device/base",
104         "//third_party/re2",
105       ]
106     }
107
108     if (is_tizen) {
109       sources += [
110         "serial_device_enumerator_linux.cc",
111         "serial_device_enumerator_linux.h",
112       ]
113     }
114   }
115
116   static_library("test_support") {
117     testonly = true
118
119     sources = [
120       "fake_serial_device_enumerator.cc",
121       "fake_serial_device_enumerator.h",
122     ]
123
124     deps = [
125       ":serial",
126       "//base",
127     ]
128   }
129 }