blob: 36bd325282957819d3b586fe3f7b983ce4830af6 [file] [log] [blame]
# Copyright 2021 The Chromium OS 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("//common-mk/generate-dbus-adaptors.gni")
import("//common-mk/pkg_config.gni")
group("all") {
deps = [ ":hpsd" ]
if (use.test) {
deps += [
":dev_test",
":hps_test",
]
}
}
generate_dbus_adaptors("hpsd-adaptors") {
dbus_service_config = "daemon/dbus_bindings/dbus-service-config.json"
dbus_adaptors_out_dir = "include/dbus_adaptors"
sources = [ "daemon/dbus_bindings/org.chromium.Hps.xml" ]
}
static_library("hps-core") {
sources = [ "daemon/hps_daemon.cc" ]
pkg_deps = [
"libbrillo",
"libchrome",
"system_api",
]
deps = [
":fakedev",
":hpsd-adaptors",
":hpslib",
]
}
executable("hpsd") {
sources = [ "daemon/main.cc" ]
pkg_deps = [
"libbrillo",
"libchrome",
]
deps = [ ":hps-core" ]
}
static_library("hpslib") {
sources = [
"hps.cc",
"hps.h",
]
pkg_deps = [ "libchrome" ]
deps = [
":dev",
":hal",
]
}
static_library("hal") {
sources = [
"hal/ftdi.cc",
"hal/ftdi.h",
"hal/i2c.cc",
"hal/i2c.h",
"hal/mcp.cc",
"hal/mcp.h",
"hal/retry.cc",
"hal/retry.h",
"hal/uart.cc",
"hal/uart.h",
]
pkg_deps = [
"libchrome",
"libftdi1",
"libusb-1.0",
]
deps = [ ":dev" ]
}
static_library("fakedev") {
sources = [
"hal/fake_dev.cc",
"hal/fake_dev.h",
]
pkg_deps = [ "libchrome" ]
deps = [ ":dev" ]
}
static_library("dev") {
sources = [
"dev.cc",
"dev.h",
"hps_reg.h",
]
}
if (use.test) {
executable("dev_test") {
sources = [ "dev_test.cc" ]
configs += [ "//common-mk:test" ]
pkg_deps = [ "libchrome" ]
deps = [
":dev",
"//common-mk/testrunner:testrunner",
]
}
executable("hps_test") {
sources = [ "hps_test.cc" ]
configs += [ "//common-mk:test" ]
pkg_deps = [ "libchrome" ]
deps = [
":fakedev",
":hpslib",
"//common-mk/testrunner:testrunner",
]
}
}