blob: 6753178681c4afa2852c25a33ca4c43b5a687a7b [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/generate-dbus-adaptors.gni")
import("//common-mk/pkg_config.gni")
group("all") {
deps = [
":libmtpd",
":mtpd",
":mtpd-adaptors",
]
if (use.test) {
deps += [ ":mtpd_testrunner" ]
}
}
pkg_config("target_defaults") {
# NOSORT
pkg_deps = [
"libbrillo",
"libchrome",
"libmtp",
"libudev",
# 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",
]
}
generate_dbus_adaptors("mtpd-adaptors") {
dbus_service_config = "dbus_bindings/dbus-service-config.json"
dbus_adaptors_out_dir = "include/mtpd/dbus_adaptors"
sources = [ "dbus_bindings/org.chromium.Mtpd.xml" ]
}
static_library("libmtpd") {
configs += [ ":target_defaults" ]
sources = [
"assert_matching_file_types.cc",
"device_manager.cc",
"file_entry.cc",
"mtpd_server_impl.cc",
"storage_info.cc",
]
deps = [ ":mtpd-adaptors" ]
}
executable("mtpd") {
configs += [ ":target_defaults" ]
sources = [ "main.cc" ]
deps = [
":libmtpd",
":mtpd-adaptors",
]
}
if (use.test) {
executable("mtpd_testrunner") {
configs += [
"//common-mk:test",
":target_defaults",
]
sources = [ "device_manager_test.cc" ]
deps = [
":libmtpd",
":mtpd-adaptors",
"//common-mk/testrunner",
]
}
}