blob: 5856a4f6a290c7b6ea57956deb9472a701d0f0f0 [file] [log] [blame]
# Copyright 2018 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/pkg_config.gni")
import("//common-mk/proto_library.gni")
group("all") {
deps = [
":g2ftool",
":u2fd",
]
if (use.test) {
deps += [ ":g2f_client_test" ]
}
}
pkg_config("target_defaults") {
pkg_deps = [
"libbrillo-${libbase_ver}",
"libchrome-${libbase_ver}",
"libsession_manager-client",
]
}
pkg_config("u2fd_config") {
pkg_deps = [
"libmetrics-${libbase_ver}",
"libpower_manager-client",
"libtrunks",
"openssl",
# system_api depends on protobuf (or protobuf-lite). It must appear
# before protobuf here or the linker flags won't be in the right
# order.
"system_api",
"protobuf-lite",
]
}
executable("u2fd") {
configs += [
":target_defaults",
":u2fd_config",
]
sources = [
"main.cc",
"tpm_vendor_cmd.cc",
"u2f_adpu.cc",
"u2fhid.cc",
"uhid_device.cc",
"user_state.cc",
"util.cc",
]
libs = [ "policy-${libbase_ver}" ]
deps = [
":user_state_proto",
"//common-mk/external_dependencies:policy-protos",
]
}
proto_library("user_state_proto") {
proto_in_dir = "."
proto_out_dir = "include/u2fd"
sources = [
"user_state.proto",
]
}
executable("g2ftool") {
configs += [ ":target_defaults" ]
sources = [
"g2f_tools/g2ftool.cc",
]
deps = [
":libg2fclient",
]
}
static_library("libg2fclient") {
configs += [ ":target_defaults" ]
sources = [
"g2f_tools/g2f_client.cc",
]
libs = [ "hidapi-hidraw" ]
}
if (use.test) {
pkg_config("g2f_client_test_config") {
pkg_deps = [ "libchrome-test-${libbase_ver}" ]
}
executable("g2f_client_test") {
configs += [
"//common-mk:test",
":target_defaults",
":g2f_client_test_config",
]
sources = [
"g2f_tools/g2f_client.cc",
"g2f_tools/g2f_client_test.cc",
]
deps = [
"//common-mk/testrunner",
]
}
}