blob: bf6eff78db0e0a88892de2cc8757f525c21b5d1d [file] [log] [blame]
# Copyright 2017 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("//build/config/features.gni")
if (is_win || (is_linux && use_udev) || is_mac) {
config("platform_support") {
visibility = [ ":serial" ]
if (is_win) {
libs = [ "setupapi.lib" ]
ldflags = [ "/DELAYLOAD:setupapi.dll" ]
}
}
source_set("serial") {
visibility = [
":test_support",
"//services/device:lib",
"//services/device:tests",
]
sources = [
"buffer.cc",
"buffer.h",
"serial_device_enumerator.cc",
"serial_device_enumerator.h",
"serial_device_enumerator_linux.cc",
"serial_device_enumerator_linux.h",
"serial_device_enumerator_mac.cc",
"serial_device_enumerator_mac.h",
"serial_device_enumerator_win.cc",
"serial_device_enumerator_win.h",
"serial_io_handler.cc",
"serial_io_handler.h",
"serial_io_handler_win.cc",
"serial_io_handler_win.h",
"serial_port_impl.cc",
"serial_port_impl.h",
"serial_port_manager_impl.cc",
"serial_port_manager_impl.h",
]
public_configs = [ ":platform_support" ]
public_deps = [
"//services/device/public/mojom:serial",
]
deps = [
"//base",
"//mojo/public/cpp/bindings",
"//net",
]
if (is_posix) {
sources += [
"serial_io_handler_posix.cc",
"serial_io_handler_posix.h",
]
}
if (use_udev) {
deps += [ "//device/udev_linux" ]
}
if (is_chromeos) {
deps += [ "//chromeos/dbus/permission_broker" ]
}
if (is_mac) {
libs = [
"Foundation.framework",
"IOKit.framework",
]
}
if (is_win) {
deps += [
"//device/base",
"//third_party/re2",
]
}
}
static_library("test_support") {
testonly = true
sources = [
"fake_serial_device_enumerator.cc",
"fake_serial_device_enumerator.h",
]
deps = [
":serial",
"//base",
]
}
}