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.
5 import("//build/config/features.gni")
6 import("//mojo/public/tools/bindings/mojom.gni")
8 # Library works only on desktop platforms.
9 if (is_win || is_linux || is_mac || is_tizen) {
10 config("platform_support") {
11 visibility = [ ":serial" ]
13 libs = [ "setupapi.lib" ]
14 ldflags = [ "/DELAYLOAD:setupapi.dll" ]
18 static_library("serial") {
21 "//device:device_unittests",
22 "//services/device/serial",
23 "//tools/battor_agent:battor_agent_lib",
26 output_name = "device_serial"
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_posix.cc",
42 "serial_io_handler_posix.h",
43 "serial_io_handler_win.cc",
44 "serial_io_handler_win.h",
47 public_configs = [ ":platform_support" ]
52 "//services/device/public/mojom",
56 "//mojo/public/cpp/system",
62 deps += [ "//device/udev_linux" ]
72 "Foundation.framework",
77 set_sources_assignment_filter([])
79 "serial_device_enumerator_linux.cc",
80 "serial_device_enumerator_linux.h",
82 set_sources_assignment_filter(sources_assignment_filter)
86 static_library("test_support") {
87 # TODO(leonhsl): Merge necessary parts of TestSerialIoHandler into
88 # battor_connection_impl_unittest.cc to hide serial impl completely.
89 visibility = [ "//tools/battor_agent:battor_agent_unittests" ]
92 "test_serial_io_handler.cc",
93 "test_serial_io_handler.h",