blob: b9c00686a297a6bfb029c26a3a6dabf98aba09cb [file] [log] [blame]
# Copyright 2022 The ChromiumOS Authors
# 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/generate-dbus-proxies.gni")
import("//common-mk/mojom_bindings_generator.gni")
import("//common-mk/pkg_config.gni")
import("//common-mk/proto_library.gni")
group("all") {
deps = [
":faced",
":faced_cli",
":install_dbus_conf",
":install_init_conf",
"camera:all",
"faced_cli:all",
]
if (use.test) {
deps += [
":faced_test_runner",
":util_unittests",
]
}
}
install_config("install_dbus_conf") {
sources = [ "dbus/org.chromium.FaceAuthDaemon.conf" ]
install_path = "/etc/dbus-1/system.d/"
}
install_config("install_init_conf") {
sources = [ "init/faced.conf" ]
install_path = "/etc/init"
}
generate_mojom_bindings("face_auth_mojo_bindings") {
mojo_root = "${platform2_root}"
sources = [ "mojom/faceauth.mojom" ]
}
# Face Service proto definitions
proto_library("face_service_proto") {
proto_in_dir = "proto/"
proto_out_dir = "include/faced/proto"
gen_grpc = true
sources = [ "proto/face_service.proto" ]
}
pkg_config("target_defaults_pkg_deps") {
pkg_deps = [
"absl",
"grpc++",
"libbrillo",
"libchrome",
"libminijail",
"libmojo",
"protobuf",
]
}
generate_dbus_proxies("libfaced_dbus_proxy") {
proxy_output_file = "include/dbus_proxies/dbus-proxies.h"
sources = [ "dbus/org.chromium.FaceAuthDaemon.xml" ]
}
generate_dbus_adaptors("libfaced_dbus_adaptor") {
dbus_service_config = "dbus/dbus-service-config.json"
dbus_adaptors_out_dir = "include/faced/dbus_adaptors"
sources = [ "dbus/org.chromium.FaceAuthDaemon.xml" ]
}
source_set("libfaced") {
sources = [
"authentication_session.cc",
"common/face_status.cc",
"dbus_adaptor.cc",
"enrollment_session.cc",
"enrollment_storage.cc",
"face_auth_daemon.cc",
"face_auth_service.cc",
"face_auth_service_impl.cc",
"face_service.cc",
"session.cc",
"status_to_string.cc",
"util/queueing_stream.cc",
"util/template.h",
]
public = [
"util/queueing_stream.h",
"util/stream.h",
]
all_dependent_configs = [ ":target_defaults_pkg_deps" ]
deps = [
":face_auth_mojo_bindings",
":face_service_proto",
":libfaced_dbus_adaptor",
":libfaced_dbus_proxy",
"camera",
]
}
executable("faced") {
sources = [ "main.cc" ]
deps = [ ":libfaced" ]
install_path = "/usr/sbin"
}
executable("faced_cli") {
sources = [ "faced_cli/main.cc" ]
deps = [
":libfaced",
"faced_cli",
]
install_path = "/usr/sbin"
}
if (use.test) {
pkg_config("test_pkg_deps") {
pkg_deps = [
"libbrillo-test",
"libchrome-test",
]
}
executable("faced_test_runner") {
sources = [
"authentication_session_test.cc",
"dbus_adaptor_test.cc",
"enrollment_session_test.cc",
"enrollment_storage_test.cc",
"face_auth_service_impl_test.cc",
"face_service_test.cc",
"testing/face_service.cc",
"testrunner.cc",
"util/template_test.cc",
]
configs += [
"//common-mk:test",
":target_defaults_pkg_deps",
":test_pkg_deps",
]
run_test = true
deps = [
":libfaced",
"faced_cli:unit_tests",
"//common-mk/testrunner",
]
}
executable("util_unittests") {
sources = [
"util/blocking_future_test.cc",
"util/lease_test.cc",
"util/queueing_stream_test.cc",
"util/status_test.cc",
]
configs += [
"//common-mk:test",
":target_defaults_pkg_deps",
":test_pkg_deps",
]
run_test = true
deps = [ "//common-mk/testrunner" ]
}
}