blob: bb08f4148c3d0c1f61da2ab8a499f2ea2e8dca2c [file] [log] [blame]
# Copyright 2019 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")
import("//common-mk/proto_library.gni")
group("all") {
deps = [
":modemfwd",
]
if (use.test) {
deps += [ ":modemfw_test" ]
}
if (use.fuzzer) {
deps += [
":firmware_manifest_fuzzer",
":firmware_manifest_v2_fuzzer",
]
}
}
pkg_config("target_defaults") {
pkg_deps = [
"libchrome-${libbase_ver}",
"libbrillo",
"libcros_config",
"libshill-client",
"liblzma",
# system_api depends on protobuf. It must appear before protobuf
# here or the linker flags won't be in the right order.
"system_api",
"protobuf",
]
}
proto_library("modemfw-protos") {
proto_in_dir = "."
proto_out_dir = "include/modemfwd/proto_bindings"
sources = [
"${proto_in_dir}/firmware_manifest.proto",
"${proto_in_dir}/firmware_manifest_v2.proto",
"${proto_in_dir}/helper_manifest.proto",
"${proto_in_dir}/journal_entry.proto",
]
}
generate_dbus_adaptors("modemfwd_adaptors") {
dbus_service_config = "dbus_bindings/dbus-service-config.json"
dbus_adaptors_out_dir = "include/modemfwd/dbus_adaptors"
new_fd_bindings = true
sources = [
"dbus_bindings/org.chromium.Modemfwd.xml",
]
}
static_library("libmodemfw") {
configs += [ ":target_defaults" ]
deps = [
":modemfw-protos",
]
sources = [
"file_decompressor.cc",
"firmware_directory.cc",
"firmware_file.cc",
"firmware_manifest.cc",
"firmware_manifest_v2.cc",
"journal.cc",
"logging.cc",
"modem.cc",
"modem_flasher.cc",
"modem_helper.cc",
"modem_helper_directory.cc",
"modem_tracker.cc",
"scoped_temp_file.cc",
]
}
executable("modemfwd") {
configs += [ ":target_defaults" ]
deps = [
":libmodemfw",
":modemfwd_adaptors",
]
sources = [
"daemon.cc",
"main.cc",
]
}
if (use.test) {
executable("modemfw_test") {
configs += [
":target_defaults",
"//common-mk:test",
]
pkg_deps = [ "libchrome-test-${libbase_ver}" ]
deps = [
":libmodemfw",
"//common-mk/testrunner:testrunner",
]
sources = [
"file_decompressor_test.cc",
"firmware_directory_stub.cc",
"firmware_directory_test.cc",
"firmware_file_test.cc",
"journal_test.cc",
"modem_flasher_test.cc",
]
}
}
if (use.fuzzer) {
executable("firmware_manifest_fuzzer") {
configs += [
"//common-mk/common_fuzzer",
":target_defaults",
]
pkg_deps = [ "libprotobuf-mutator" ]
sources = [
"firmware_manifest_fuzzer.cc",
]
deps = [
":libmodemfw",
]
}
executable("firmware_manifest_v2_fuzzer") {
configs += [
"//common-mk/common_fuzzer",
":target_defaults",
]
pkg_deps = [ "libprotobuf-mutator" ]
sources = [
"firmware_manifest_v2_fuzzer.cc",
]
deps = [
":libmodemfw",
]
}
}