Upload upstream chromium 69.0.3497
[platform/framework/web/chromium-efl.git] / device / serial / BUILD.gn
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.
4
5 import("//build/config/features.gni")
6 import("//mojo/public/tools/bindings/mojom.gni")
7
8 # Library works only on desktop platforms.
9 if (is_win || is_linux || is_mac || is_tizen) {
10   config("platform_support") {
11     visibility = [ ":serial" ]
12     if (is_win) {
13       libs = [ "setupapi.lib" ]
14       ldflags = [ "/DELAYLOAD:setupapi.dll" ]
15     }
16   }
17
18   static_library("serial") {
19     visibility = [
20       ":test_support",
21       "//device:device_unittests",
22       "//services/device/serial",
23       "//tools/battor_agent:battor_agent_lib",
24     ]
25
26     output_name = "device_serial"
27
28     sources = [
29       "buffer.cc",
30       "buffer.h",
31       "serial_device_enumerator.cc",
32       "serial_device_enumerator.h",
33       "serial_device_enumerator_linux.cc",
34       "serial_device_enumerator_linux.h",
35       "serial_device_enumerator_mac.cc",
36       "serial_device_enumerator_mac.h",
37       "serial_device_enumerator_win.cc",
38       "serial_device_enumerator_win.h",
39       "serial_io_handler.cc",
40       "serial_io_handler.h",
41       "serial_io_handler_win.cc",
42       "serial_io_handler_win.h",
43     ]
44
45     public_configs = [ ":platform_support" ]
46
47     public_deps = [
48       "//base",
49       "//device/base",
50       "//services/device/public/mojom",
51     ]
52
53     deps = [
54       "//mojo/public/cpp/system",
55       "//net",
56       "//third_party/re2",
57     ]
58
59     if (is_posix) {
60       sources += [
61         "serial_io_handler_posix.cc",
62         "serial_io_handler_posix.h",
63       ]
64     }
65     if (use_udev) {
66       deps += [ "//device/udev_linux" ]
67     }
68     if (is_chromeos) {
69       deps += [
70         "//chromeos",
71         "//dbus",
72       ]
73     }
74     if (is_mac) {
75       libs = [
76         "Foundation.framework",
77         "IOKit.framework",
78       ]
79     }
80     if (is_tizen) {
81       set_sources_assignment_filter([])
82       sources += [
83         "serial_device_enumerator_linux.cc",
84         "serial_device_enumerator_linux.h",
85       ]
86       set_sources_assignment_filter(sources_assignment_filter)
87     }
88   }
89
90   static_library("test_support") {
91     # TODO(leonhsl): Merge necessary parts of TestSerialIoHandler into
92     # battor_connection_impl_unittest.cc to hide serial impl completely.
93     visibility = [ "//tools/battor_agent:battor_agent_unittests" ]
94
95     sources = [
96       "test_serial_io_handler.cc",
97       "test_serial_io_handler.h",
98     ]
99
100     public_deps = [
101       ":serial",
102     ]
103   }
104 }