Upload upstream chromium 71.0.3578.0
[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     ]
24
25     output_name = "device_serial"
26
27     sources = [
28       "buffer.cc",
29       "buffer.h",
30       "serial_device_enumerator.cc",
31       "serial_device_enumerator.h",
32       "serial_device_enumerator_linux.cc",
33       "serial_device_enumerator_linux.h",
34       "serial_device_enumerator_mac.cc",
35       "serial_device_enumerator_mac.h",
36       "serial_device_enumerator_win.cc",
37       "serial_device_enumerator_win.h",
38       "serial_io_handler.cc",
39       "serial_io_handler.h",
40       "serial_io_handler_win.cc",
41       "serial_io_handler_win.h",
42     ]
43
44     public_configs = [ ":platform_support" ]
45
46     public_deps = [
47       "//base",
48       "//device/base",
49       "//services/device/public/mojom",
50     ]
51
52     deps = [
53       "//mojo/public/cpp/system",
54       "//net",
55       "//third_party/re2",
56     ]
57
58     if (is_posix) {
59       sources += [
60         "serial_io_handler_posix.cc",
61         "serial_io_handler_posix.h",
62       ]
63     }
64     if (use_udev) {
65       deps += [ "//device/udev_linux" ]
66     }
67     if (is_chromeos) {
68       deps += [
69         "//chromeos",
70         "//dbus",
71       ]
72     }
73     if (is_mac) {
74       libs = [
75         "Foundation.framework",
76         "IOKit.framework",
77       ]
78     }
79     if (is_tizen) {
80       set_sources_assignment_filter([])
81       sources += [
82         "serial_device_enumerator_linux.cc",
83         "serial_device_enumerator_linux.h",
84       ]
85       set_sources_assignment_filter(sources_assignment_filter)
86     }
87   }
88 }