blob: 31df85c58c7e838062e830f3ae848c67950f6abc [file] [log] [blame]
# Copyright 2018 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/pkg_config.gni")
import("//common-mk/proto_library.gni")
group("all") {
deps = [
":install_conf",
":install_udev",
":mist",
]
if (use.test) {
deps += [ ":mist_testrunner" ]
}
}
pkg_config("target_defaults") {
pkg_deps = [
"libbrillo",
"libchrome",
"libmetrics",
"libusb-1.0",
"protobuf",
]
}
proto_library("mist-protos") {
proto_in_dir = "proto"
proto_out_dir = "include/mist/proto_bindings"
sources = [
"${proto_in_dir}/config.proto",
"${proto_in_dir}/usb_modem_info.proto",
]
}
static_library("libmist") {
sources = [
"config_loader.cc",
"context.cc",
"event_dispatcher.cc",
"metrics.cc",
"mist.cc",
"usb_modem_one_shot_switcher.cc",
"usb_modem_switch_context.cc",
"usb_modem_switch_operation.cc",
"usb_modem_switcher.cc",
]
configs += [ ":target_defaults" ]
deps = [ ":mist-protos" ]
}
executable("mist") {
sources = [ "main.cc" ]
configs += [ ":target_defaults" ]
install_path = "bin"
deps = [ ":libmist" ]
}
install_config("install_conf") {
sources = [ "default.conf" ]
install_path = "/usr/share/mist"
}
install_config("install_udev") {
sources = [ "51-mist.rules" ]
install_path = "/lib/udev/rules.d"
}
if (use.test) {
pkg_config("mist_testrunner_config") {
pkg_deps = [ "libchrome-test" ]
}
executable("mist_testrunner") {
sources = [
"config_loader_test.cc",
"mist.cc",
"mock_context.cc",
"usb_modem_switch_context_test.cc",
]
configs += [
"//common-mk:test",
":target_defaults",
]
run_test = true
deps = [
":libmist",
"//common-mk/testrunner:testrunner",
]
}
}